cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[ curl-Bugs-3472244 ] FOLLOWLOCATION and subsequent headers

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Wed, 11 Jan 2012 14:54:31 -0800

Bugs item #3472244, was opened at 2012-01-10 21:07
Message generated for change (Comment added) made by buccinator
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3472244&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: libcurl
Group: bad behaviour
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: swan (buccinator)
Assigned to: Daniel Stenberg (bagder)
Summary: FOLLOWLOCATION and subsequent headers

Initial Comment:
The Server on the subsequent request via followlocation is waiting for extra data and hangs; as the Content-Type and Content-Length headers are included in the second request.

This isnt normal behaviour is it?!

My debug is in the below <snip>pets, aswell as another example found online. My debug has had the URLs changed by hand so there might be typos.

http://core.trac.wordpress.org/ticket/17490#comment:11

<snip>
> POST /DIRECTORY/Search.mvc HTTP/1.1
Host: www.XXXX.com
User-Agent: Mozilla/5.0 (Ubuntu; X11; Linux x86_64; rv:8.0) Gecko/20100101 Firefox/8.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Referer: https://www.XXXX.com/DIRECTORY/
Content-Type: application/x-www-form-urlencoded
Content-Length: 493

< HTTP/1.1 302 Found
< Cache-Control: private
< Content-Length: 230
< Content-Type: text/html; charset=utf-8
< Location: /DIRECTORY/Search.mvc/Result?somewhere_else=true
< X-AspNet-Version: 4.0.30319
< Date: Wed, 11 Jan 2012 03:22:18 GMT
<
* Ignoring the response-body
* Connection #0 to host www.XXXX.com left intact
* Issue another request to this URL: 'https://www.XXXX.com/DIRECTORY/Search.mvc/Result?somewhere_else=true'
* Violate RFC 2616/10.3.3 and switch from POST to GET
* Re-using existing connection! (#0) with host www.licence.nsw.gov.au
* Connected to www.licence.nsw.gov.au (203.202.139.229) port 443 (#0)
> GET /DIRECTORY/Search.mvc/Result?somewhere_else=true HTTP/1.1
Host: www.XXXX.com
User-Agent: Mozilla/5.0 (Ubuntu; X11; Linux x86_64; rv:8.0) Gecko/20100101 Firefox/8.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Referer: https://www.XXXX.com/DIRECTORY/
Content-Type: application/x-www-form-urlencoded
Content-Length: 493
</snip>

----------------------------------------------------------------------

>Comment By: swan (buccinator)
Date: 2012-01-11 14:54

Message:
have submitted a bug to PHP instead, apologies..

https://bugs.php.net/bug.php?id=60721

----------------------------------------------------------------------

Comment By: swan (buccinator)
Date: 2012-01-11 14:38

Message:
sorry, i did not have curl installed, i was using php5-curl
5.3.6-13ubuntu3.3

i mocked up my own redir.php similar to the original reponse headers from
the original snippet. and with curl binary it works as you said. using the
php-wrappers, i get the "bad" behaviour and hang time.

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2012-01-11 14:01

Message:
Sorry but I can't see that. Here's a command line I use in order to try to
repeat your problem:

$ curl daniel.haxx.se/test/redir.cgi -d moo -vL -o /dev/null

I've tried curl 7.23.1 and my dev version 7.24.0-DEV and they both handle
this fine.

----------------------------------------------------------------------

Comment By: swan (buccinator)
Date: 2012-01-11 13:53

Message:
yes i am adding those headers myself, if i dont set Content-Type,
Content-Length is still automatically inserted and sent in the follow up
request and the server still hangs expecting more data. to repeat the issue
send a POST request with some body data which will automatically send a
Content-Length in the inital request to a server whos next response will be
a 302 Location. the following request made by curl will include the
Content-Length (automatically generated or manually inserted from the
inital) and the server will wait until body data of said length is recieved
(which never happens).

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2012-01-11 01:39

Message:
Can you please tell us exactly how to repeat this issue?

Are you possibly inserting those headers yourself?

----------------------------------------------------------------------

Comment By: swan (buccinator)
Date: 2012-01-10 21:11

Message:
i also forgot to remove some domains from by debug :p please do so if you
can, im a n00b on most levels and cant see how to edit/delete this entry

----------------------------------------------------------------------

Comment By: swan (buccinator)
Date: 2012-01-10 21:09

Message:
sorry forgot to mention, im using

libcurl3 7.21.6-3ubuntu3

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3472244&group_id=976
Received on 2012-01-11

These mail archives are generated by hypermail.

donate! Page updated January 05, 2012.
web site info

File upload with ASP.NET