cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl gets into infinite redirect loop

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 30 Dec 2011 20:46:59 +0100 (CET)

On Thu, 29 Dec 2011, Alex Vinnik wrote:

> Added strtolower function to http.c. Was not sure if libcurl has similar
> function. See code diff below. It fixed the problem! curl now gets to the
> final destination. Run all tests.

Thanks for verifying this. The fact that all tests still run fine only tells
us that we don't do proper mixed case host name tests...

I took this issue to the httpbis mailing list
(http://lists.w3.org/Archives/Public/ietf-http-wg/2011OctDec/0582.html) and so
far all agree that lower casing unconditionally is wrong, protocol-wise. I
would rather work on making sure we switch to the host name as given in the
Location: header even when the connection is re-used.

I haven't yet looked at the code to consider how this should be done.

A downside with this approach is of course if sites start rejecting requests
entirely based on case sensitive matches instead of "just" redirecting over
to the lower case version.

-- 
  / 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-30