aboutsummaryrefslogtreecommitdiff
path: root/tests/data/test1142
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-05-08 15:11:10 +0200
committerDaniel Stenberg <daniel@haxx.se>2016-05-30 23:13:55 +0200
commit5409e1d793de755c7433336b80b0c8370a359d45 (patch)
tree45a9791d3bf2aa623e0999c5b13128b9d967f810 /tests/data/test1142
parented8b8f2456fc485fa81fb3d3eaef684121bb1aef (diff)
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
Diffstat (limited to 'tests/data/test1142')
-rw-r--r--tests/data/test114262
1 files changed, 62 insertions, 0 deletions
diff --git a/tests/data/test1142 b/tests/data/test1142
new file mode 100644
index 000000000..ebb0891b6
--- /dev/null
+++ b/tests/data/test1142
@@ -0,0 +1,62 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 302 This is a weirdo text message
+Connection: close
+Location: http:////foo.example.com/want/11420001
+
+This server reply is for testing
+</data>
+<data1>
+HTTP/1.1 200 hello
+Connection: close
+Content-Length: 4
+
+hej
+</data1>
+<datacheck>
+HTTP/1.1 302 This is a weirdo text message
+Connection: close
+Location: http:////foo.example.com/want/11420001
+
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP redirect to http://// (four slashes!)
+ </name>
+ <command>
+%HOSTIP:%HTTPPORT/want/1142 -L -x http://%HOSTIP:%HTTPPORT
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://%HOSTIP:%HTTPPORT/want/1142 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+# 3, CURLE_URL_MALFORMAT for the four slashes
+<errorcode>
+3
+</errorcode>
+</verify>
+</testcase>