diff options
author | Daniel Stenberg <daniel@haxx.se> | 2018-12-17 15:46:56 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-12-21 10:49:30 +0100 |
commit | 006ff62d8c51f664c167c6337f009f9f65dd8ea7 (patch) | |
tree | d3c28ede3f9a04053c3bcd5d2b2eb7cb5a191735 /tests | |
parent | db9776ea00226d1571e269464237b0d50191a0a3 (diff) | |
download | curl-006ff62d8c51f664c167c6337f009f9f65dd8ea7.tar.gz |
http: added options for allowing HTTP/0.9 responses
Added CURLOPT_HTTP09_ALLOWED and --http0.9 for this purpose.
For now, both the tool and library allow HTTP/0.9 by default.
docs/DEPRECATE.md lays out the plan for when to reverse that default: 6
months after the 7.64.0 release. The options are added already now so
that applications/scripts can start using them already now.
Fixes #2873
Closes #3383
Diffstat (limited to 'tests')
-rw-r--r-- | tests/data/Makefile.inc | 3 | ||||
-rw-r--r-- | tests/data/test1144 | 3 | ||||
-rw-r--r-- | tests/data/test1164 | 2 | ||||
-rw-r--r-- | tests/data/test1172 | 50 | ||||
-rw-r--r-- | tests/data/test1266 | 2 | ||||
-rw-r--r-- | tests/data/test1267 | 2 | ||||
-rw-r--r-- | tests/data/test1400 | 1 | ||||
-rw-r--r-- | tests/data/test1401 | 1 | ||||
-rw-r--r-- | tests/data/test1402 | 1 | ||||
-rw-r--r-- | tests/data/test1403 | 1 | ||||
-rw-r--r-- | tests/data/test1404 | 1 | ||||
-rw-r--r-- | tests/data/test1405 | 1 | ||||
-rw-r--r-- | tests/data/test1406 | 1 | ||||
-rw-r--r-- | tests/data/test1407 | 1 | ||||
-rw-r--r-- | tests/data/test1420 | 1 | ||||
-rw-r--r-- | tests/data/test1429 | 3 | ||||
-rw-r--r-- | tests/data/test306 | 2 | ||||
-rw-r--r-- | tests/data/test66 | 3 |
18 files changed, 71 insertions, 8 deletions
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc index 52916c983..9c31d907e 100644 --- a/tests/data/Makefile.inc +++ b/tests/data/Makefile.inc @@ -130,7 +130,8 @@ test1144 test1145 test1146 test1147 test1148 test1149 test1150 test1151 \ test1152 test1153 test1154 test1155 test1156 test1157 test1158 test1159 \ \ test1160 test1161 test1162 test1163 test1164 \ -test1170 test1171 \ +test1170 test1171 test1172 \ +\ test1200 test1201 test1202 test1203 test1204 test1205 test1206 test1207 \ test1208 test1209 test1210 test1211 test1212 test1213 test1214 test1215 \ test1216 test1217 test1218 test1219 \ diff --git a/tests/data/test1144 b/tests/data/test1144 index 3fb90936a..84c22dba2 100644 --- a/tests/data/test1144 +++ b/tests/data/test1144 @@ -3,6 +3,7 @@ <keywords> HTTP HTTP HEAD +HTTP/0.9 </keywords> </info> @@ -46,7 +47,7 @@ http HTTP HEAD, receive no headers only body </name> <command> --I http://%HOSTIP:%HTTPPORT/1144 +-I http://%HOSTIP:%HTTPPORT/1144 --http0.9 </command> </client> diff --git a/tests/data/test1164 b/tests/data/test1164 index be83aa4f3..a5ce6d11a 100644 --- a/tests/data/test1164 +++ b/tests/data/test1164 @@ -29,7 +29,7 @@ http HTTP/0.9 GET and all zeroes </name> <command option="force-output"> -http://%HOSTIP:%HTTPPORT/1164 -w '%{size_download}\n' +http://%HOSTIP:%HTTPPORT/1164 -w '%{size_download}\n' --http0.9 </command> </client> diff --git a/tests/data/test1172 b/tests/data/test1172 new file mode 100644 index 000000000..6e61720bd --- /dev/null +++ b/tests/data/test1172 @@ -0,0 +1,50 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP/0.9 +</keywords> +</info> + +# +# Server-side +<reply> +<data> +-foo- swsclose +</data> +<datacheck> +</datacheck> +</reply> + +# +# Client-side +<client> +<server> +http +</server> + <name> +HTTP/0.9 GET response denied + </name> + <command> +http://%HOSTIP:%HTTPPORT/1172 --no-http0.9 +</command> +</client> + +# +# Verify data after the test has been "shot" +<verify> +<strip> +^User-Agent:.* +</strip> +<protocol> +GET /1172 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol> +# unsupported protocol +<errorcode> +1 +</errorcode> +</verify> +</testcase> diff --git a/tests/data/test1266 b/tests/data/test1266 index 75ed7bdc9..cab11efa0 100644 --- a/tests/data/test1266 +++ b/tests/data/test1266 @@ -26,7 +26,7 @@ http HTTP GET with a single-byte HTTP/0.9 response </name> <command> -http://%HOSTIP:%HTTPPORT/1266 +http://%HOSTIP:%HTTPPORT/1266 --http0.9 </command> </client> diff --git a/tests/data/test1267 b/tests/data/test1267 index 8f2a63b78..82d37445d 100644 --- a/tests/data/test1267 +++ b/tests/data/test1267 @@ -26,7 +26,7 @@ http HTTP GET with a invalid HTTP/1 response line start </name> <command> -http://%HOSTIP:%HTTPPORT/1267 +http://%HOSTIP:%HTTPPORT/1267 --http0.9 </command> </client> diff --git a/tests/data/test1400 b/tests/data/test1400 index 10faef39b..36ddd0e91 100644 --- a/tests/data/test1400 +++ b/tests/data/test1400 @@ -54,6 +54,7 @@ s/(USERAGENT, \")[^\"]+/${1}stripped/ $_ = '' if /CURLOPT_SSL_VERIFYPEER/ $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ $_ = '' if /CURLOPT_HTTP_VERSION/ +$_ = '' if /CURLOPT_HTTP09_ALLOWED/ </stripfile> <file name="log/test1400.c" mode="text"> /********* Sample code generated by the curl command line tool ********** diff --git a/tests/data/test1401 b/tests/data/test1401 index f330931c9..d7033e0b5 100644 --- a/tests/data/test1401 +++ b/tests/data/test1401 @@ -87,6 +87,7 @@ int main(int argc, char *argv[]) curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, slist1); curl_easy_setopt(hnd, CURLOPT_USERAGENT, "MyUA"); curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); + curl_easy_setopt(hnd, CURLOPT_HTTP09_ALLOWED, 1L); curl_easy_setopt(hnd, CURLOPT_COOKIE, "chocolate=chip"); curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); diff --git a/tests/data/test1402 b/tests/data/test1402 index 9a9428376..978b26162 100644 --- a/tests/data/test1402 +++ b/tests/data/test1402 @@ -79,6 +79,7 @@ int main(int argc, char *argv[]) curl_easy_setopt(hnd, CURLOPT_POSTFIELDSIZE_LARGE, (curl_off_t)16); curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped"); curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); + curl_easy_setopt(hnd, CURLOPT_HTTP09_ALLOWED, 1L); curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); diff --git a/tests/data/test1403 b/tests/data/test1403 index 79cdf4964..9c838d0ed 100644 --- a/tests/data/test1403 +++ b/tests/data/test1403 @@ -74,6 +74,7 @@ int main(int argc, char *argv[]) curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/1403?foo=bar&baz=quux"); curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped"); curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); + curl_easy_setopt(hnd, CURLOPT_HTTP09_ALLOWED, 1L); curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); diff --git a/tests/data/test1404 b/tests/data/test1404 index 9c6f2e726..a00bf10a3 100644 --- a/tests/data/test1404 +++ b/tests/data/test1404 @@ -143,6 +143,7 @@ int main(int argc, char *argv[]) curl_easy_setopt(hnd, CURLOPT_MIMEPOST, mime1); curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped"); curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); + curl_easy_setopt(hnd, CURLOPT_HTTP09_ALLOWED, 1L); curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); diff --git a/tests/data/test1405 b/tests/data/test1405 index 73769eed1..4f477c7d9 100644 --- a/tests/data/test1405 +++ b/tests/data/test1405 @@ -136,6 +136,7 @@ $_ = '' if /CURLOPT_MAXREDIRS/ $_ = '' if /CURLOPT_SSL_VERIFYPEER/ $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ $_ = '' if /CURLOPT_HTTP_VERSION/ +$_ = '' if /CURLOPT_HTTP09_ALLOWED/ </stripfile> </verify> </testcase> diff --git a/tests/data/test1406 b/tests/data/test1406 index 796dd2254..7d973e7ef 100644 --- a/tests/data/test1406 +++ b/tests/data/test1406 @@ -122,6 +122,7 @@ $_ = '' if /CURLOPT_MAXREDIRS/ $_ = '' if /CURLOPT_SSL_VERIFYPEER/ $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ $_ = '' if /CURLOPT_HTTP_VERSION/ +$_ = '' if /CURLOPT_HTTP09_ALLOWED/ </stripfile> </verify> </testcase> diff --git a/tests/data/test1407 b/tests/data/test1407 index 9800eeef3..883cf4064 100644 --- a/tests/data/test1407 +++ b/tests/data/test1407 @@ -100,6 +100,7 @@ $_ = '' if /CURLOPT_MAXREDIRS/ $_ = '' if /CURLOPT_SSL_VERIFYPEER/ $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ $_ = '' if /CURLOPT_HTTP_VERSION/ +$_ = '' if /CURLOPT_HTTP09_ALLOWED/ </stripfile> </verify> </testcase> diff --git a/tests/data/test1420 b/tests/data/test1420 index 081ac6bbb..c3d31f349 100644 --- a/tests/data/test1420 +++ b/tests/data/test1420 @@ -66,6 +66,7 @@ int main(int argc, char *argv[]) curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); curl_easy_setopt(hnd, CURLOPT_URL, "imap://%HOSTIP:%IMAPPORT/1420/;MAILINDEX=1"); curl_easy_setopt(hnd, CURLOPT_USERPWD, "user:secret"); + curl_easy_setopt(hnd, CURLOPT_HTTP09_ALLOWED, 1L); curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); diff --git a/tests/data/test1429 b/tests/data/test1429 index 114dc0dba..20b031a1e 100644 --- a/tests/data/test1429 +++ b/tests/data/test1429 @@ -3,6 +3,7 @@ <keywords> HTTP HTTP GET +HTTP/0.9 </keywords> </info> @@ -34,7 +35,7 @@ http HTTP GET with 4-digit response code </name> <command> -http://%HOSTIP:%HTTPPORT/1429 --write-out '%{response_code}' +http://%HOSTIP:%HTTPPORT/1429 --write-out '%{response_code}' --http0.9 </command> </client> diff --git a/tests/data/test306 b/tests/data/test306 index 95d4cef35..17306f949 100644 --- a/tests/data/test306 +++ b/tests/data/test306 @@ -45,7 +45,7 @@ https HTTPS GET, receive no headers only data! </name> <command> --k https://%HOSTIP:%HTTPSPORT/306 +-k https://%HOSTIP:%HTTPSPORT/306 --http0.9 </command> </client> diff --git a/tests/data/test66 b/tests/data/test66 index a018d8fd4..7b9af2953 100644 --- a/tests/data/test66 +++ b/tests/data/test66 @@ -3,6 +3,7 @@ <keywords> HTTP HTTP GET +HTTP/0.9 </keywords> </info> # Server-side @@ -21,7 +22,7 @@ http HTTP GET without headers in the response </name> <command> -http://%HOSTIP:%HTTPPORT/66 +http://%HOSTIP:%HTTPPORT/66 --http0.9 </command> </client> |