diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-08-20 00:34:44 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-08-24 10:02:41 +0200 |
commit | 98c94596f5928840177b6bd3c7b0f0dd03a431af (patch) | |
tree | 280a4d57dffd2222c39c9e481b6bbbbd5adec397 /tests/data | |
parent | bc3b5bcf87f9fe16514f8cfd84cded24a367ac95 (diff) | |
download | curl-98c94596f5928840177b6bd3c7b0f0dd03a431af.tar.gz |
etag: save and use the full received contents
... which makes it support weak tags and non-standard etags too!
Added test case 347 to verify blank incoming ETag:
Fixes #5610
Closes #5833
Diffstat (limited to 'tests/data')
-rw-r--r-- | tests/data/Makefile.inc | 2 | ||||
-rw-r--r-- | tests/data/test1566 | 2 | ||||
-rw-r--r-- | tests/data/test339 | 4 | ||||
-rw-r--r-- | tests/data/test342 | 2 | ||||
-rw-r--r-- | tests/data/test343 | 4 | ||||
-rw-r--r-- | tests/data/test344 | 2 | ||||
-rw-r--r-- | tests/data/test345 | 4 | ||||
-rw-r--r-- | tests/data/test347 | 62 |
8 files changed, 72 insertions, 10 deletions
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc index 3752502ef..9261ee221 100644 --- a/tests/data/Makefile.inc +++ b/tests/data/Makefile.inc @@ -58,7 +58,7 @@ test307 test308 test309 test310 test311 test312 test313 test314 test315 \ test316 test317 test318 test319 test320 test321 test322 test323 test324 \ test325 test326 test327 test328 test329 test330 test331 test332 test333 \ test334 test335 test336 test337 test338 test339 test340 test341 test342 \ -test343 test344 test345 test346 \ +test343 test344 test345 test346 test347 \ test350 test351 test352 test353 test354 test355 test356 test357 test358 \ test359 \ test393 test394 test395 test396 test397 \ diff --git a/tests/data/test1566 b/tests/data/test1566 index e6f81711d..cc3ac474a 100644 --- a/tests/data/test1566 +++ b/tests/data/test1566 @@ -35,7 +35,7 @@ http http://%HOSTIP:%HTTPPORT/1566 -o log/output1566 --etag-compare log/etag1566 </command> <file name="log/etag1566"> -123456 +"123456" </file> <file1 name="log/output1566"> downloaded already diff --git a/tests/data/test339 b/tests/data/test339 index cd6e49892..8da212e55 100644 --- a/tests/data/test339 +++ b/tests/data/test339 @@ -14,7 +14,7 @@ Server: fakeit/0.9 fakeitbad/1.0 Transfer-Encoding: chunked
Trailer: chunky-trailer
Connection: mooo
-ETag: "asdf"
+ETag: W/"asdf"
40 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa @@ -56,7 +56,7 @@ Accept: */* </protocol> <file name="log/etag339"> -asdf +W/"asdf" </file> </verify> diff --git a/tests/data/test342 b/tests/data/test342 index 95297ba50..75295cfa8 100644 --- a/tests/data/test342 +++ b/tests/data/test342 @@ -34,7 +34,7 @@ http Check if --etag-compare set correct etag in header </name> <file name="log/etag342"> -21025-dc7-39462498 +"21025-dc7-39462498" </file> <command> http://%HOSTIP:%HTTPPORT/342 --etag-compare log/etag342 diff --git a/tests/data/test343 b/tests/data/test343 index e55a181d8..5d877827f 100644 --- a/tests/data/test343 +++ b/tests/data/test343 @@ -34,7 +34,7 @@ http Both --etag-compare and --etag-save to save new Etag </name> <file name="log/etag343"> -21025-dc7-39462498 +"21025-dc7-39462498" </file> <command> http://%HOSTIP:%HTTPPORT/343 --etag-compare log/etag343 --etag-save log/out343 @@ -55,7 +55,7 @@ If-None-Match: "21025-dc7-39462498" </protocol> <file name="log/out343"> -21025-dc7-11111 +"21025-dc7-11111" </file> </verify> </testcase> diff --git a/tests/data/test344 b/tests/data/test344 index 054d0351b..2b730d524 100644 --- a/tests/data/test344 +++ b/tests/data/test344 @@ -52,7 +52,7 @@ If-None-Match: "" </protocol> <file name="log/etag344"> -21025-dc7-11111 +"21025-dc7-11111" </file> </verify> </testcase> diff --git a/tests/data/test345 b/tests/data/test345 index 135e0c26a..c30c06de9 100644 --- a/tests/data/test345 +++ b/tests/data/test345 @@ -34,7 +34,7 @@ http Both --etag-compare and -save store new Etag using one pre-existing file </name> <file name="log/etag345"> -21025-dc7-39462498 +"21025-dc7-39462498" </file> <command> http://%HOSTIP:%HTTPPORT/345 --etag-compare log/etag345 --etag-save log/etag345 @@ -55,7 +55,7 @@ If-None-Match: "21025-dc7-39462498" </protocol> <file name="log/etag345"> -21025-dc7-11111 +"21025-dc7-11111" </file> </verify> </testcase> diff --git a/tests/data/test347 b/tests/data/test347 new file mode 100644 index 000000000..702c270f9 --- /dev/null +++ b/tests/data/test347 @@ -0,0 +1,62 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +</keywords> +</info> +# +# Server-side +<reply> +<data nocheck="yes"> +HTTP/1.1 200 funky chunky!
+Server: fakeit/0.9 fakeitbad/1.0
+Transfer-Encoding: chunked
+Trailer: chunky-trailer
+Connection: mooo
+ETag:
+
+40 +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +30 +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +21;heresatest=moooo +cccccccccccccccccccccccccccccccc + +0 +chunky-trailer: header data + +</data> +</reply> + +# +# Client-side +<client> +<server> +http +</server> +<name> +--etag-save with blank incoming header +</name> +<command> +http://%HOSTIP:%HTTPPORT/347 --etag-save log/etag347 +</command> +</client> + +# +# Verify data after the test has been "shot" +<verify> +<strip> +^User-Agent:.* +</strip> +<protocol> +GET /347 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol> +<file name="log/etag347"> +</file> +</verify> + +</testcase> |