cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl stumbles on weird redirect location

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 27 Dec 2011 19:07:25 +0100 (CET)

On Sun, 25 Dec 2011, Alex Vinnik wrote:

> You are right about that http://www.officedepot.com;**jsessionid=**
> 0000EXsMRFMF5kwJo26qgOif31d:**13ddq0tfm is treated as search term by Chrome
> BUT I am afraid I was not entirely clear that THIS url
> http://www.officedepot.com/promo/redir.do?siteid=qpF0HYnRugA-63LcCNNtsuVrjXbS8XCqNA&url=http://www.officedepot.com
> needs to be used as seed one. The server responds with 301 with that weird
> "Location" header. However when you try this seed url in chrome it navigates
> correctly to new location. The mystery for me is that Chrome seems to get
> well-formed location header in contrast to curl. Here is Chrome log captured
> from chrome://net-internals/#events. Please see below...

That's not really strange. The site probably has some nasty and broken
heuristics to figure out what browser that is in use and then it sends back
different responses - including headers.

The Firefox version of the URLs are still wrong.

By the way, my Firefox bug report for this issue is now here:
https://bugzilla.mozilla.org/show_bug.cgi?id=713472 and it seems that Firefox
9 will not treat those URLs as legal ones and then that site might have to do
something else...

> Any special requests headers that make the difference? Wonder if I can
> achieve similar effect with curl.

If you compare both Firefox's and Chrome's "route" you might detect
differences. They may also very well use javascript or whatever to detect
what's in use and act from that.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-12-27