diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-09-10 20:58:51 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-09-10 20:58:51 +0000 |
commit | b8b56248bddc646bf8d262dc9c5b45ce68a1ef08 (patch) | |
tree | 582ff2a2e1bded2a6750c18b3dd8c45dc060f293 /tests | |
parent | 33929117f9ffff56f978a75233326969b803659a (diff) |
- Bug report #1025986. When following a Location: with a custom Host: header
replacement, curl only replaced the Host: header on the initial request
and didn't replace it on the following ones. This resulted in requests with
two Host: headers.
Now, curl checks if the location is on the same host as the initial request
and then continues to replace the Host: header. And when it moves to another
host, it doesn't replace the Host: header but it also doesn't make the
second Host: header get used in the request.
This change is verified by the two new test cases 184 and 185.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/data/Makefile.am | 3 | ||||
-rw-r--r-- | tests/data/test184 | 67 | ||||
-rw-r--r-- | tests/data/test185 | 67 |
3 files changed, 136 insertions, 1 deletions
diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 02f618bb6..3135a419a 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -25,7 +25,8 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \ test158 test159 test511 test160 test161 test162 test163 test164 \ test512 test165 test166 test167 test168 test169 test170 test171 \ test172 test204 test205 test173 test174 test175 test176 test177 \ - test513 test514 test178 test179 test180 test181 test182 test183 + test513 test514 test178 test179 test180 test181 test182 test183 \ + test184 test185 # The following tests have been removed from the dist since they no longer # work. We need to fix the test suite's FTPS server first, then bring them diff --git a/tests/data/test184 b/tests/data/test184 new file mode 100644 index 000000000..547993f6a --- /dev/null +++ b/tests/data/test184 @@ -0,0 +1,67 @@ +# Server-side +<reply> +<data> +HTTP/1.1 301 OK swsbounce
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 4
+Location: http://yet.another.host/184 +
+moo +</data> +<data1> +HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 4
+
+moo +</data1> +<datacheck> +HTTP/1.1 301 OK swsbounce
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 4
+Location: http://yet.another.host/184 +
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 4
+
+moo +</datacheck> +</reply> + +# Client-side +<client> +<server> +http +</server> +<features> +SSL +</features> + <name> +HTTP replace Host: when following Location: to new host + </name> + <command> +http://deathstar.another.galaxy/184 -L -H "Host: another.visitor.stay.a.while.stay.foreeeeeever" --proxy http://%HOSTIP:%HTTPPORT +</command> +</test> + +# Verify data after the test has been "shot" +<verify> +<strip> +^User-Agent: curl/.* +</strip> +<protocol> +GET http://deathstar.another.galaxy/184 HTTP/1.1
+User-Agent: curl/7.12.2-CVS (i686-pc-linux-gnu) libcurl/7.12.2-CVS OpenSSL/0.9.6b zlib/1.1.4 libidn/0.4.6
+Pragma: no-cache
+Accept: */*
+Host: another.visitor.stay.a.while.stay.foreeeeeever
+
+GET http://yet.another.host/184 HTTP/1.1
+Host: yet.another.host
+Pragma: no-cache
+Accept: */*
+
+</protocol> + +</verify> diff --git a/tests/data/test185 b/tests/data/test185 new file mode 100644 index 000000000..2af7b1425 --- /dev/null +++ b/tests/data/test185 @@ -0,0 +1,67 @@ +# Server-side +<reply> +<data> +HTTP/1.1 301 OK swsbounce
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 4
+Location: go/west/185
+
+moo +</data> +<data1> +HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 4
+
+moo +</data1> +<datacheck> +HTTP/1.1 301 OK swsbounce
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 4
+Location: go/west/185
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 4
+
+moo +</datacheck> +</reply> + +# Client-side +<client> +<server> +http +</server> +<features> +SSL +</features> + <name> +HTTP replace Host: when following Location: on the same host + </name> + <command> +http://deathstar.another.galaxy/185 -L -H "Host: another.visitor.stay.a.while.stay.foreeeeeever" --proxy http://%HOSTIP:%HTTPPORT +</command> +</test> + +# Verify data after the test has been "shot" +<verify> +<strip> +^User-Agent: curl/.* +</strip> +<protocol> +GET http://deathstar.another.galaxy/185 HTTP/1.1
+User-Agent: curl/7.12.2-CVS (i686-pc-linux-gnu) libcurl/7.12.2-CVS OpenSSL/0.9.6b zlib/1.1.4 libidn/0.4.6
+Pragma: no-cache
+Accept: */*
+Host: another.visitor.stay.a.while.stay.foreeeeeever
+
+GET http://deathstar.another.galaxy/go/west/185 HTTP/1.1
+Pragma: no-cache
+Accept: */*
+Host: another.visitor.stay.a.while.stay.foreeeeeever
+
+</protocol> + +</verify> |