From: Fabian Keil Date: Thu, 19 Jun 2025 10:27:36 +0000 (+0200) Subject: Add a couple of tests for connection headers with keep-alive-timeout set X-Git-Url: http://www.privoxy.org/gitweb/%22https:/@default-cgi@/faq/user-manual/@default-cgi@edit-actions-add-url-form?a=commitdiff_plain;h=d62a6a3de2179b075732cc22810346c5c9b8a8d8;p=privoxy.git Add a couple of tests for connection headers with keep-alive-timeout set --- 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