diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-09-12 00:20:22 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-09-13 12:29:59 +0200 |
commit | 4a8fa48946c80ad1dc8cd65f965c4d7be2acbec0 (patch) | |
tree | f9aefe019166e434839bc1e7326d8ffa5f0a4b85 /tests/data | |
parent | 8822ecf7a18c6977ac09b707ff720e503e81bfaf (diff) | |
download | curl-4a8fa48946c80ad1dc8cd65f965c4d7be2acbec0.tar.gz |
http_proxy: fix the User-Agent inclusion in CONNECT
It should not refer to the uagent string that is allocated and created
for the end server http request, as that pointer may be cleared on
subsequent CONNECT requests.
Added test case 1184 to verify.
Reported-by: T200proX7 on github
Fixes #7705
Closes #7707
Diffstat (limited to 'tests/data')
-rw-r--r-- | tests/data/Makefile.inc | 2 | ||||
-rw-r--r-- | tests/data/test1184 | 108 |
2 files changed, 109 insertions, 1 deletions
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc index 6c6ab09de..59e1145fc 100644 --- a/tests/data/Makefile.inc +++ b/tests/data/Makefile.inc @@ -141,7 +141,7 @@ test1152 test1153 test1154 test1155 test1156 test1157 test1158 test1159 \ test1160 test1161 test1162 test1163 test1164 test1165 test1166 test1167 \ test1168 test1169 test1170 test1171 test1172 test1173 test1174 test1175 \ test1176 test1177 test1178 test1179 test1180 test1181 test1182 test1183 \ -\ +test1184 \ test1188 \ \ test1190 test1191 test1192 test1193 test1194 test1195 test1196 test1197 \ diff --git a/tests/data/test1184 b/tests/data/test1184 new file mode 100644 index 000000000..feac348ef --- /dev/null +++ b/tests/data/test1184 @@ -0,0 +1,108 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP CONNECT +HTTP proxy +proxytunnel +</keywords> +</info> + +# +# Server-side +<reply> +<connect> +HTTP/1.1 200 Mighty fine indeed
+Server: test tunnel 2000
+
+</connect> + +<data nocheck="yes"> +HTTP/1.1 302 OK
+Location: http://%HOSTIP.%TESTNUMBER:%HTTPPORT/we/want/that/page/%TESTNUMBER0002
+Date: Tue, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Type: text/html
+Funny-head: yesyes
+Content-Length: 9
+Connection: close
+
+contents +</data> + +<data2 nocheck="yes"> +HTTP/1.1 200 OK
+Content-Length: 7
+
+second +</data2> +</reply> + +# +# Client-side +<client> +<server> +http +http-proxy +</server> + <name> +HTTP 1.1 CONNECT with redirect and set -H user-agent + </name> + <command> +-x %HOSTIP:%PROXYPORT -p http://%HOSTIP.%TESTNUMBER:%HTTPPORT/we/want/that/page/%TESTNUMBER -L -H "User-Agent: %TESTNUMBER-agent" +</command> +<features> +proxy +</features> +</client> + +# +# Verify data after the test has been "shot" +<verify> +<proxy> +CONNECT %HOSTIP.%TESTNUMBER:%HTTPPORT HTTP/1.1
+Host: %HOSTIP.%TESTNUMBER:%HTTPPORT
+User-Agent: curl/%VERSION
+Proxy-Connection: Keep-Alive
+
+CONNECT %HOSTIP.%TESTNUMBER:%HTTPPORT HTTP/1.1
+Host: %HOSTIP.%TESTNUMBER:%HTTPPORT
+User-Agent: curl/%VERSION
+Proxy-Connection: Keep-Alive
+
+</proxy> +<protocol> +GET /we/want/that/page/%TESTNUMBER HTTP/1.1
+Host: %HOSTIP.%TESTNUMBER:%HTTPPORT
+Accept: */*
+User-Agent: %TESTNUMBER-agent
+
+GET /we/want/that/page/%TESTNUMBER0002 HTTP/1.1
+Host: %HOSTIP.%TESTNUMBER:%HTTPPORT
+Accept: */*
+User-Agent: %TESTNUMBER-agent
+
+</protocol> +<stdout> +HTTP/1.1 200 Mighty fine indeed
+Server: test tunnel 2000
+
+HTTP/1.1 302 OK
+Location: http://%HOSTIP.%TESTNUMBER:%HTTPPORT/we/want/that/page/%TESTNUMBER0002
+Date: Tue, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Type: text/html
+Funny-head: yesyes
+Content-Length: 9
+Connection: close
+
+HTTP/1.1 200 Mighty fine indeed
+Server: test tunnel 2000
+
+HTTP/1.1 200 OK
+Content-Length: 7
+
+second +</stdout> +</verify> +</testcase> |