http-client "hangs" if following a POST request

Bug #955574 reported by Matthias Brantner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
Medium
Matthias Brantner

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.

Related branches

Changed in zorba:
milestone: none → 2.2
Changed in zorba:
milestone: 2.2 → 2.3
status: New → In Progress
Changed in zorba:
status: In Progress → Fix Committed
Changed in zorba:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.