cURL / Mailing Lists / curl-library / Single Mail

curl-library

http:/// and other slash amounts

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 9 May 2016 14:56:42 +0200 (CEST)

Hey,

We recently got issue #791 filed[1]. It shows a problem with a site that uses
a 301 redirect to an absolute URL.

The redirect works fine with Chrome and Firefox, but not with (lib)curl
because the URL in the response header has _three_ slashes after http:. Like
"http:///example.com".

After some experimenting, it seems the popular browsers are _very_ leniant
with the amount of slashes and they basically allow any amount from one to at
least ten. So these sites can test their stuff with browsers and all is fine
and dandy...

Now, we can take the hard stance here and say that this is not a common
problem and the site is CLEARLY doing the wrong thing here.

or

We can say that since it works with several popular browsers, shouldn't it
work with curl as well? (I have a patch that makes curl accept one, two or
three slashes)

What do you think is the correct way forward? And please, let us not add an
option to select behavior! =)

[1] = https://github.com/curl/curl/issues/791

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:  https://curl.haxx.se/mail/etiquette.html
Received on 2016-05-09