From d62a6a3de2179b075732cc22810346c5c9b8a8d8 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Thu, 19 Jun 2025 12:27:36 +0200 Subject: [PATCH] Add a couple of tests for connection headers with keep-alive-timeout set --- .../data/test1 | 45 +++++++++++++++++ .../data/test10 | 45 +++++++++++++++++ .../data/test11 | 48 +++++++++++++++++++ .../data/test12 | 47 ++++++++++++++++++ .../data/test2 | 45 +++++++++++++++++ .../data/test3 | 45 +++++++++++++++++ .../data/test4 | 45 +++++++++++++++++ .../data/test5 | 45 +++++++++++++++++ .../data/test6 | 45 +++++++++++++++++ .../data/test7 | 45 +++++++++++++++++ .../data/test8 | 45 +++++++++++++++++ .../data/test9 | 45 +++++++++++++++++ .../privoxy.conf | 16 +++++++ 13 files changed, 561 insertions(+) create mode 100644 tests/cts/connection-headers-with-keep-alive-timeout-set/data/test1 create mode 100644 tests/cts/connection-headers-with-keep-alive-timeout-set/data/test10 create mode 100644 tests/cts/connection-headers-with-keep-alive-timeout-set/data/test11 create mode 100644 tests/cts/connection-headers-with-keep-alive-timeout-set/data/test12 create mode 100644 tests/cts/connection-headers-with-keep-alive-timeout-set/data/test2 create mode 100644 tests/cts/connection-headers-with-keep-alive-timeout-set/data/test3 create mode 100644 tests/cts/connection-headers-with-keep-alive-timeout-set/data/test4 create mode 100644 tests/cts/connection-headers-with-keep-alive-timeout-set/data/test5 create mode 100644 tests/cts/connection-headers-with-keep-alive-timeout-set/data/test6 create mode 100644 tests/cts/connection-headers-with-keep-alive-timeout-set/data/test7 create mode 100644 tests/cts/connection-headers-with-keep-alive-timeout-set/data/test8 create mode 100644 tests/cts/connection-headers-with-keep-alive-timeout-set/data/test9 create mode 100644 tests/cts/connection-headers-with-keep-alive-timeout-set/privoxy.conf diff --git a/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test1 b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test1 new file mode 100644 index 00000000..5843fe14 --- /dev/null +++ b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test1 @@ -0,0 +1,45 @@ + + + +HTTP +HTTP GET + + + + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +http + + +Simple "Connection: close" header + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + + + + diff --git a/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test10 b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test10 new file mode 100644 index 00000000..edd769c9 --- /dev/null +++ b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test10 @@ -0,0 +1,45 @@ + + + +HTTP +HTTP GET + + + + + +HTTP/1.1 200 OK +Connection: keep-alive +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +HTTP/1.1 200 OK +Connection: keep-alive +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +http + + +Empty "Connection:" header with "keep-alive" keyword and lots of whitespace + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + + + + diff --git a/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test11 b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test11 new file mode 100644 index 00000000..95ca532f --- /dev/null +++ b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test11 @@ -0,0 +1,48 @@ + + + +HTTP +HTTP GET + + + + + +HTTP/1.1 200 OK +Connection: keep-alive +Connection: close +Connection: close +Connection: keep-alive +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +HTTP/1.1 200 OK +Connection: keep-alive +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +http + + +Multiple conflicting "Connection:" headers. + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + + + + diff --git a/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test12 b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test12 new file mode 100644 index 00000000..925103a0 --- /dev/null +++ b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test12 @@ -0,0 +1,47 @@ + + + +HTTP +HTTP GET + + + + + +HTTP/1.1 200 OK +Connection: close +Connection: keep-alive +Connection: close +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +http + + +Multiple conflicting "Connection:" headers. + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + + + + diff --git a/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test2 b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test2 new file mode 100644 index 00000000..1c2b67f2 --- /dev/null +++ b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test2 @@ -0,0 +1,45 @@ + + + +HTTP +HTTP GET + + + + + +HTTP/1.1 200 OK +Connection: keep-alive +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +HTTP/1.1 200 OK +Connection: keep-alive +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +http + + +Simple "Connection: keep-alive" header + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + + + + diff --git a/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test3 b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test3 new file mode 100644 index 00000000..d3607418 --- /dev/null +++ b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test3 @@ -0,0 +1,45 @@ + + + +HTTP +HTTP GET + + + + + +HTTP/1.1 200 OK +Connection: keep-alive, Upgrade +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +HTTP/1.1 200 OK +Connection: keep-alive +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +http + + +"Connection:" header with unsupported "upgrade" keyword + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + + + + diff --git a/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test4 b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test4 new file mode 100644 index 00000000..cb21ad54 --- /dev/null +++ b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test4 @@ -0,0 +1,45 @@ + + + +HTTP +HTTP GET + + + + + +HTTP/1.1 200 OK +Connection: keep-alive, blafasel, tralala, yolo, test, hoho +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +http + + +"Connection:" header with "too many" keywords + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + + + + diff --git a/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test5 b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test5 new file mode 100644 index 00000000..39e0df13 --- /dev/null +++ b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test5 @@ -0,0 +1,45 @@ + + + +HTTP +HTTP GET + + + + + +HTTP/1.1 200 OK +Connection: keep-alive, test1, test2, test3 +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +HTTP/1.1 200 OK +Connection: keep-alive +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +http + + +"Connection:" header with some unsupported keywords + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + + + + diff --git a/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test6 b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test6 new file mode 100644 index 00000000..45e9d7ae --- /dev/null +++ b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test6 @@ -0,0 +1,45 @@ + + + +HTTP +HTTP GET + + + + + +HTTP/1.1 200 OK +Connection: test1, test2, test3, keep-alive +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +HTTP/1.1 200 OK +Connection: keep-alive +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +http + + +"Connection:" header with some unsupported keywords, keep-alive keyword at the end + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + + + + diff --git a/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test7 b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test7 new file mode 100644 index 00000000..f5071449 --- /dev/null +++ b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test7 @@ -0,0 +1,45 @@ + + + +HTTP +HTTP GET + + + + + +HTTP/1.1 200 OK +Connection: KeEp-aLiVe +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +HTTP/1.1 200 OK +Connection: KeEp-aLiVe +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +http + + +"Connection:" header with "KeEp-aLiVe" keyword + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + + + + diff --git a/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test8 b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test8 new file mode 100644 index 00000000..2b498eba --- /dev/null +++ b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test8 @@ -0,0 +1,45 @@ + + + +HTTP +HTTP GET + + + + + +HTTP/1.1 200 OK +Connection: , +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +http + + +"Connection:" header with single comma instead of actual keywords + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + + + + diff --git a/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test9 b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test9 new file mode 100644 index 00000000..1f990d54 --- /dev/null +++ b/tests/cts/connection-headers-with-keep-alive-timeout-set/data/test9 @@ -0,0 +1,45 @@ + + + +HTTP +HTTP GET + + + + + +HTTP/1.1 200 OK +Connection: +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/plain +Content-Length: 10 + +Blafasel. + + + + + +http + + +Empty "Connection:" header + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + + + + diff --git a/tests/cts/connection-headers-with-keep-alive-timeout-set/privoxy.conf b/tests/cts/connection-headers-with-keep-alive-timeout-set/privoxy.conf new file mode 100644 index 00000000..72c021f4 --- /dev/null +++ b/tests/cts/connection-headers-with-keep-alive-timeout-set/privoxy.conf @@ -0,0 +1,16 @@ +listen-address 127.0.0.1:9119 + +debug 1 # Log the destination for each request Privoxy let through. See also debug 1024. +debug 2 # show each connection status +debug 4 # show tagging-related messages +debug 8 # show header parsing +debug 32 # debug force feature +debug 64 # debug regular expression filters +debug 128 # debug redirects +debug 256 # debug GIF de-animation +debug 512 # Common Log Format +debug 1024 # Log the destination for requests Privoxy didn't let through, and the reason why. +debug 4096 # Startup banner and warnings. +debug 8192 # Non-fatal errors + +keep-alive-timeout 1 -- 2.49.0