← Back to team overview

zorba-coders team mailing list archive

[Bug 955574] Re: http-client "hangs" if following a POST request

 

** Changed in: zorba
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/955574

Title:
  http-client "hangs" if following a POST request

Status in Zorba - The XQuery Processor:
  Fix Released

Bug description:
  Making the following request to a resource that sends a 301 or 302
  redirect doesn't terminate.

    http:send-request(
     <http:request href="http://some-ressource"; method="POST" follow-redirect="true">
        <http:header name="Content-Length" value="4"/>
        <http:body media-type="text/plain">test</http:body>
     </http:request>
    )

  The reason is that the http-client tells curl to follow the redirect.
  In turn, curl issues a GET request with the Content-Length header set
  to the size of the payload of the original POST request. However, the
  response doesn't come back because no data is sent with the redirected
  GET request.

  A suggested solution is to raise an error if one tries to follow POST,
  PUT, or DELETE requests. The semantic of doing this is not clear and
  it's up to the user what to do. For example, the user might want to
  follow-up using a GET request or with another POST containing the same
  data. Raising an error allows the user of the http-client to do
  whatever is required.

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/955574/+subscriptions


References