From 5409e1d793de755c7433336b80b0c8370a359d45 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 8 May 2016 15:11:10 +0200 Subject: URL parser: allow URLs to use one, two or three slashes Mostly in order to support broken web sites that redirect to broken URLs that are accepted by browsers. Browsers are typically even more leniant than this as the WHATWG URL spec they should allow an _infinite_ amount. I tested 8000 slashes with Firefox and it just worked. Added test case 1141, 1142 and 1143 to verify the new parser. Closes #791 --- tests/data/test1141 | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 tests/data/test1141 (limited to 'tests/data/test1141') diff --git a/tests/data/test1141 b/tests/data/test1141 new file mode 100644 index 000000000..31c505f66 --- /dev/null +++ b/tests/data/test1141 @@ -0,0 +1,67 @@ + + + +HTTP +HTTP GET +followlocation + + +# Server-side + + +HTTP/1.1 302 This is a weirdo text message +Connection: close +Location: http:///foo.example.com/want/11410001 + +This server reply is for testing + + +HTTP/1.1 200 hello +Connection: close +Content-Length: 4 + +hej + + +HTTP/1.1 302 This is a weirdo text message +Connection: close +Location: http:///foo.example.com/want/11410001 + +HTTP/1.1 200 hello +Connection: close +Content-Length: 4 + +hej + + + +# Client-side + + +http + + +HTTP redirect to http:/// (three slashes!) + + +%HOSTIP:%HTTPPORT/want/1141 -L -x http://%HOSTIP:%HTTPPORT + + + +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +GET http://%HOSTIP:%HTTPPORT/want/1141 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET http://foo.example.com/want/11410001 HTTP/1.1 +Host: foo.example.com +Accept: */* + + + + -- cgit v1.2.3