[Privoxy-commits] [privoxy] 05/07: Add a couple of tests for connection headers with keep-alive-timeout set

User Git git at git.privoxy.org
Tue Jun 24 14:10:24 CEST 2025


This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository privoxy.

commit d62a6a3de2179b075732cc22810346c5c9b8a8d8
Author: Fabian Keil <fk at fabiankeil.de>
AuthorDate: Thu Jun 19 12:27:36 2025 +0200

    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(+)

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 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Connection: close
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Connection: close
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</proxy-reply>
+
+<client>
+<server>
+http
+</server>
+<name>
+Simple "Connection: close" header
+</name>
+<command>
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+</verify>
+</testcase>
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 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Connection:                         keep-alive        
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Connection: keep-alive
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</proxy-reply>
+
+<client>
+<server>
+http
+</server>
+<name>
+Empty "Connection:" header with "keep-alive" keyword and lots of whitespace
+</name>
+<command>
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+</verify>
+</testcase>
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 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Connection: keep-alive
+Connection: close
+Connection: close
+Connection: keep-alive
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Connection: keep-alive
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</proxy-reply>
+
+<client>
+<server>
+http
+</server>
+<name>
+Multiple conflicting "Connection:" headers.
+</name>
+<command>
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+</verify>
+</testcase>
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 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Connection: close
+Connection: keep-alive
+Connection: close
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Connection: close
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</proxy-reply>
+
+<client>
+<server>
+http
+</server>
+<name>
+Multiple conflicting "Connection:" headers.
+</name>
+<command>
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+</verify>
+</testcase>
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 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Connection: keep-alive
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Connection: keep-alive
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</proxy-reply>
+
+<client>
+<server>
+http
+</server>
+<name>
+Simple "Connection: keep-alive" header
+</name>
+<command>
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+</verify>
+</testcase>
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 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Connection: keep-alive, Upgrade
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Connection: keep-alive
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</proxy-reply>
+
+<client>
+<server>
+http
+</server>
+<name>
+"Connection:" header with unsupported "upgrade" keyword
+</name>
+<command>
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+</verify>
+</testcase>
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 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Connection: keep-alive, blafasel, tralala, yolo, test, hoho
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Connection: close
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</proxy-reply>
+
+<client>
+<server>
+http
+</server>
+<name>
+"Connection:" header with "too many" keywords
+</name>
+<command>
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+</verify>
+</testcase>
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 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Connection: keep-alive, test1, test2, test3
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Connection: keep-alive
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</proxy-reply>
+
+<client>
+<server>
+http
+</server>
+<name>
+"Connection:" header with some unsupported keywords
+</name>
+<command>
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+</verify>
+</testcase>
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 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Connection: test1, test2, test3, keep-alive
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Connection: keep-alive
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</proxy-reply>
+
+<client>
+<server>
+http
+</server>
+<name>
+"Connection:" header with some unsupported keywords, keep-alive keyword at the end
+</name>
+<command>
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+</verify>
+</testcase>
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 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Connection: KeEp-aLiVe
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Connection: KeEp-aLiVe
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</proxy-reply>
+
+<client>
+<server>
+http
+</server>
+<name>
+"Connection:" header with "KeEp-aLiVe" keyword
+</name>
+<command>
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+</verify>
+</testcase>
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 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Connection: ,
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Connection: close
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</proxy-reply>
+
+<client>
+<server>
+http
+</server>
+<name>
+"Connection:" header with single comma instead of actual keywords
+</name>
+<command>
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+</verify>
+</testcase>
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 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Connection:
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Connection: close
+Content-Type: text/plain
+Content-Length: 10
+
+Blafasel.
+</data>
+</proxy-reply>
+
+<client>
+<server>
+http
+</server>
+<name>
+Empty "Connection:" header
+</name>
+<command>
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+</verify>
+</testcase>
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

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Privoxy-commits mailing list