From 70cf50fb4aa5e55ca2e732716a4f455d39192088 Mon Sep 17 00:00:00 2001 From: David Cook Date: Mon, 3 May 2021 19:29:40 -0500 Subject: [PATCH] tests: ignore case of chunked hex numbers in tests When hyper is used, it emits uppercase hexadecimal numbers for chunked encoding lengths. Without hyper, lowercase hexadecimal numbers are used. This change adds preprocessor statements to tests where this is an issue, and adapts the fixtures to match. Closes #6987 --- tests/data/test1072 | 4 ++++ tests/data/test1073 | 4 ++++ tests/data/test1591 | 4 ++++ tests/data/test218 | 4 ++++ tests/data/test510 | 4 ++++ tests/data/test565 | 4 ++++ tests/data/test645 | 8 ++++++++ tests/data/test650 | 12 ++++++++++++ tests/data/test654 | 4 ++++ tests/data/test667 | 4 ++++ tests/data/test668 | 4 ++++ 11 files changed, 56 insertions(+) diff --git a/tests/data/test1072 b/tests/data/test1072 index f9fb73044..c0d4c18d4 100644 --- a/tests/data/test1072 +++ b/tests/data/test1072 @@ -63,7 +63,11 @@ Accept: */* Transfer-Encoding: chunked Expect: 100-continue +%if hyper +7A +%else 7a +%endif This is data we upload with PUT it comes from stdin so MUST be sent with chunked encoding diff --git a/tests/data/test1073 b/tests/data/test1073 index 775c08798..3f6d70317 100644 --- a/tests/data/test1073 +++ b/tests/data/test1073 @@ -57,7 +57,11 @@ Accept: */* Transfer-Encoding: chunked Expect: 100-continue +%if hyper +7A +%else 7a +%endif This is data we upload with PUT it comes from stdin so MUST be sent with chunked encoding diff --git a/tests/data/test1591 b/tests/data/test1591 index 738696db1..4bc02dd13 100644 --- a/tests/data/test1591 +++ b/tests/data/test1591 @@ -48,7 +48,11 @@ Transfer-Encoding: chunked Trailer: my-super-awesome-trailer, my-other-awesome-trailer Expect: 100-continue +%if hyper +E +%else e +%endif Hello Cloud! 0 diff --git a/tests/data/test218 b/tests/data/test218 index 40c68857f..dc71442e8 100644 --- a/tests/data/test218 +++ b/tests/data/test218 @@ -47,7 +47,11 @@ Accept: */* Transfer-Encoding: chunked Expect: 100-continue +%if hyper +1E +%else 1e +%endif just some tiny teeny contents 0 diff --git a/tests/data/test510 b/tests/data/test510 index 415bbae27..b673fa11b 100644 --- a/tests/data/test510 +++ b/tests/data/test510 @@ -56,7 +56,11 @@ one two 5 three +%if hyper +1D +%else 1d +%endif and a final longer crap: four 0 diff --git a/tests/data/test565 b/tests/data/test565 index 37f70c932..92a7a702b 100644 --- a/tests/data/test565 +++ b/tests/data/test565 @@ -100,7 +100,11 @@ one two 5 three +%if hyper +1D +%else 1d +%endif and a final longer crap: four 0 diff --git a/tests/data/test645 b/tests/data/test645 index 10b6bef16..d5ce825bb 100644 --- a/tests/data/test645 +++ b/tests/data/test645 @@ -108,7 +108,11 @@ y 1 +%if hyper +19A +%else 19a +%endif ------------------------------ Content-Disposition: form-data; name="filename" @@ -169,7 +173,11 @@ y 1 +%if hyper +19A +%else 19a +%endif ------------------------------ Content-Disposition: form-data; name="filename" diff --git a/tests/data/test650 b/tests/data/test650 index 7045d3626..0e4c5d3c2 100644 --- a/tests/data/test650 +++ b/tests/data/test650 @@ -90,7 +90,11 @@ Content-Disposition: attachment; filename="test%TESTNUMBER.filedata" Content-Type: text/whatever +%if hyper +A5 +%else a5 +%endif This is data from a file. ------------------------------ @@ -98,7 +102,11 @@ Content-Disposition: attachment; filename="test%TESTNUMBER.filedata" Content-Type: text/whatever +%if hyper +AF +%else af +%endif This is data from a file. -------------------------------- @@ -107,7 +115,11 @@ This is data from a file. Content-Disposition: form-data; name="filecontents" +%if hyper +10F +%else 10f +%endif This is data from a file. ------------------------------ diff --git a/tests/data/test654 b/tests/data/test654 index 4de65d07b..d8da0da1d 100644 --- a/tests/data/test654 +++ b/tests/data/test654 @@ -81,7 +81,11 @@ Transfer-Encoding: chunked Content-Type: multipart/form-data; boundary=---------------------------- Expect: 100-continue +%if hyper +1AF +%else 1af +%endif ------------------------------ Content-Disposition: form-data; name="greeting" Content-Type: application/X-Greeting diff --git a/tests/data/test667 b/tests/data/test667 index 8ae4fd597..e54e15b0e 100644 --- a/tests/data/test667 +++ b/tests/data/test667 @@ -66,7 +66,11 @@ Transfer-Encoding: chunked Content-Type: multipart/form-data; boundary=---------------------------- Expect: 100-continue +%if hyper +7F +%else 7f +%endif ------------------------------ Content-Disposition: form-data; name="field" Content-Transfer-Encoding: base64 diff --git a/tests/data/test668 b/tests/data/test668 index dfb9347e8..0606e3707 100644 --- a/tests/data/test668 +++ b/tests/data/test668 @@ -69,7 +69,11 @@ Transfer-Encoding: chunked Content-Type: multipart/form-data; boundary=---------------------------- Expect: 100-continue +%if hyper +C1 +%else c1 +%endif ------------------------------ Content-Disposition: form-data; name="field1"