From e485c071824e070da5eca6a4ccaecb12ccbb0e84 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sat, 9 Jan 2021 16:49:29 +0100 Subject: [PATCH] Add client-header-order tests Sponsored by: Privoxy project funds collected at SPI --- tests/cts/client-header-order/data/test332 | 52 +++++++++++++++++++++ tests/cts/client-header-order/data/test333 | 52 +++++++++++++++++++++ tests/cts/client-header-order/data/test334 | 42 +++++++++++++++++ tests/cts/client-header-order/data/test335 | 54 ++++++++++++++++++++++ tests/cts/client-header-order/privoxy.conf | 20 ++++++++ 5 files changed, 220 insertions(+) create mode 100644 tests/cts/client-header-order/data/test332 create mode 100644 tests/cts/client-header-order/data/test333 create mode 100644 tests/cts/client-header-order/data/test334 create mode 100644 tests/cts/client-header-order/data/test335 create mode 100644 tests/cts/client-header-order/privoxy.conf diff --git a/tests/cts/client-header-order/data/test332 b/tests/cts/client-header-order/data/test332 new file mode 100644 index 00000000..0cf8407d --- /dev/null +++ b/tests/cts/client-header-order/data/test332 @@ -0,0 +1,52 @@ + + + +HTTP +HTTP GET + + + + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Content-Length: 9 + +Blafasel + + + + + + +http + + +HTTP client header order + + +-H "Origin: https://www.privoxy.org/" -H "Cache-Control: max-age=315576000" -H "If-Modified-Since: Thu, 07 Jan 2021 22:05:31 GMT" -H "Upgrade-Insecure-Requests: 1" -H "Pragma: no-cache" -H "DNT: 1" -H "Cookie: yolo=123" -H "Referer: https://www.example.org/" -H "Proxy-Connection: keep-alive" -H "Accept-Encoding: gzip" -H "Accept: */*" -H "Host: %HOSTIP:%HTTPPORT" -H "Accept-Language: en-CA" --user-agent "Client with unsorted headers" http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + + + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: Client with unsorted headers +Accept: */* +Accept-Language: en-CA +Accept-Encoding: gzip +Referer: https://www.example.org/ +Cookie: yolo=123 +DNT: 1 +Connection: close +Pragma: no-cache +Upgrade-Insecure-Requests: 1 +If-Modified-Since: Thu, 07 Jan 2021 22:05:31 GMT +Cache-Control: max-age=315576000 +Origin: https://www.privoxy.org/ + + + + diff --git a/tests/cts/client-header-order/data/test333 b/tests/cts/client-header-order/data/test333 new file mode 100644 index 00000000..a67eb4ff --- /dev/null +++ b/tests/cts/client-header-order/data/test333 @@ -0,0 +1,52 @@ + + + +HTTP +HTTP GET + + + + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Content-Length: 9 + +Blafasel + + + + + + +http + + +HTTP client header order 2 + + +-H "Origin: https://www.privoxy.org/" -H "Cache-Control: max-age=315576000" -H "If-Modified-Since: Thu, 07 Jan 2021 22:05:31 GMT" -H "Upgrade-Insecure-Requests: 1" -H "DNT: 1" -H "Pragma: no-cache" -H "Cookie: yolo=123" -H "Referer: https://www.example.org/" -H "Accept-Encoding: gzip" -H "Proxy-Connection: keep-alive" -H "Accept: */*" -H "Accept-Language: en-CA" -H "Host: %HOSTIP:%HTTPPORT" --user-agent "Client with unsorted headers" http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + + + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: Client with unsorted headers +Accept: */* +Accept-Language: en-CA +Accept-Encoding: gzip +Referer: https://www.example.org/ +Cookie: yolo=123 +DNT: 1 +Connection: close +Pragma: no-cache +Upgrade-Insecure-Requests: 1 +If-Modified-Since: Thu, 07 Jan 2021 22:05:31 GMT +Cache-Control: max-age=315576000 +Origin: https://www.privoxy.org/ + + + + diff --git a/tests/cts/client-header-order/data/test334 b/tests/cts/client-header-order/data/test334 new file mode 100644 index 00000000..2c7ed0f7 --- /dev/null +++ b/tests/cts/client-header-order/data/test334 @@ -0,0 +1,42 @@ + + + +HTTP +HTTP GET + + + + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Content-Length: 9 + +Blafasel + + + + + + +http + + +HTTP client header order 3. Only a few headers to sort. + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + + + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + + + + diff --git a/tests/cts/client-header-order/data/test335 b/tests/cts/client-header-order/data/test335 new file mode 100644 index 00000000..7c89c6b1 --- /dev/null +++ b/tests/cts/client-header-order/data/test335 @@ -0,0 +1,54 @@ + + + +HTTP +HTTP GET + + + + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Content-Length: 9 + +Blafasel + + + + + + +http + + +HTTP client header order 4. Left over headers. + + +-H "Bum: Tschaka" -H "Blafasel: Die da" -H "Origin: https://www.privoxy.org/" -H "Cache-Control: max-age=315576000" -H "If-Modified-Since: Thu, 07 Jan 2021 22:05:31 GMT" -H "Upgrade-Insecure-Requests: 1" -H "DNT: 1" -H "Pragma: no-cache" -H "Cookie: yolo=123" -H "Referer: https://www.example.org/" -H "Accept-Encoding: gzip" -H "Proxy-Connection: keep-alive" -H "Accept: */*" -H "Accept-Language: en-CA" -H "Host: %HOSTIP:%HTTPPORT" --user-agent "Client with unsorted headers" http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + + + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: Client with unsorted headers +Accept: */* +Accept-Language: en-CA +Accept-Encoding: gzip +Referer: https://www.example.org/ +Cookie: yolo=123 +DNT: 1 +Connection: close +Pragma: no-cache +Upgrade-Insecure-Requests: 1 +If-Modified-Since: Thu, 07 Jan 2021 22:05:31 GMT +Cache-Control: max-age=315576000 +Origin: https://www.privoxy.org/ +Bum: Tschaka +Blafasel: Die da + + + + diff --git a/tests/cts/client-header-order/privoxy.conf b/tests/cts/client-header-order/privoxy.conf new file mode 100644 index 00000000..fb15ffd8 --- /dev/null +++ b/tests/cts/client-header-order/privoxy.conf @@ -0,0 +1,20 @@ +listen-address 127.0.0.1:9119 + +client-header-order Host User-Agent Accept Accept-Language Accept-Encoding \ + Proxy-Connection Referer Cookie DNT Connection \ + Pragma Upgrade-Insecure-Requests If-Modified-Since \ + Cache-Control Content-Length Origin Content-Type + +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 + -- 2.39.2