From 6c0601ba81832d1cdd1a84dae2e02ab4192772fd Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Fri, 26 Mar 2021 12:01:28 +0100 Subject: [PATCH] Add test scenario client-body-filter-https Sponsored by: Privoxy project funds collected at SPI --- .../client-body-filter.action | 8 ++ .../client-body-filter.filter | 8 ++ tests/cts/client-body-filter-https/data/test1 | 61 ++++++++++++++ .../cts/client-body-filter-https/data/test10 | 57 +++++++++++++ .../cts/client-body-filter-https/data/test12 | 84 +++++++++++++++++++ .../cts/client-body-filter-https/data/test13 | 82 ++++++++++++++++++ .../cts/client-body-filter-https/data/test14 | 80 ++++++++++++++++++ .../cts/client-body-filter-https/data/test15 | 72 ++++++++++++++++ .../cts/client-body-filter-https/data/test16 | 71 ++++++++++++++++ .../cts/client-body-filter-https/data/test17 | 81 ++++++++++++++++++ tests/cts/client-body-filter-https/data/test2 | 61 ++++++++++++++ tests/cts/client-body-filter-https/data/test3 | 61 ++++++++++++++ tests/cts/client-body-filter-https/data/test4 | 63 ++++++++++++++ tests/cts/client-body-filter-https/data/test5 | 61 ++++++++++++++ tests/cts/client-body-filter-https/data/test6 | 61 ++++++++++++++ tests/cts/client-body-filter-https/data/test7 | 61 ++++++++++++++ tests/cts/client-body-filter-https/data/test8 | 61 ++++++++++++++ tests/cts/client-body-filter-https/data/test9 | 63 ++++++++++++++ .../cts/client-body-filter-https/privoxy.conf | 37 ++++++++ 19 files changed, 1133 insertions(+) create mode 100644 tests/cts/client-body-filter-https/client-body-filter.action create mode 100644 tests/cts/client-body-filter-https/client-body-filter.filter create mode 100644 tests/cts/client-body-filter-https/data/test1 create mode 100644 tests/cts/client-body-filter-https/data/test10 create mode 100644 tests/cts/client-body-filter-https/data/test12 create mode 100644 tests/cts/client-body-filter-https/data/test13 create mode 100644 tests/cts/client-body-filter-https/data/test14 create mode 100644 tests/cts/client-body-filter-https/data/test15 create mode 100644 tests/cts/client-body-filter-https/data/test16 create mode 100644 tests/cts/client-body-filter-https/data/test17 create mode 100644 tests/cts/client-body-filter-https/data/test2 create mode 100644 tests/cts/client-body-filter-https/data/test3 create mode 100644 tests/cts/client-body-filter-https/data/test4 create mode 100644 tests/cts/client-body-filter-https/data/test5 create mode 100644 tests/cts/client-body-filter-https/data/test6 create mode 100644 tests/cts/client-body-filter-https/data/test7 create mode 100644 tests/cts/client-body-filter-https/data/test8 create mode 100644 tests/cts/client-body-filter-https/data/test9 create mode 100644 tests/cts/client-body-filter-https/privoxy.conf diff --git a/tests/cts/client-body-filter-https/client-body-filter.action b/tests/cts/client-body-filter-https/client-body-filter.action new file mode 100644 index 00000000..40cf7820 --- /dev/null +++ b/tests/cts/client-body-filter-https/client-body-filter.action @@ -0,0 +1,8 @@ +{+client-body-filter{blafasel-to-bumfidel}} +/ + +{+client-body-filter{bumfidel-to-tralala}} +/bumfidel-to-tralala + +{+client-body-filter{empty-body}} +/.*/empty-body/ diff --git a/tests/cts/client-body-filter-https/client-body-filter.filter b/tests/cts/client-body-filter-https/client-body-filter.filter new file mode 100644 index 00000000..ecc3798a --- /dev/null +++ b/tests/cts/client-body-filter-https/client-body-filter.filter @@ -0,0 +1,8 @@ +CLIENT-BODY-FILTER: blafasel-to-bumfidel Changes "blafasel" to "bumfidel" +s@blafasel@bumfidel@ + +CLIENT-BODY-FILTER: bumfidel-to-tralala Changes "bumfidel" to "tralala" +s@bumfidel@tralala@ + +CLIENT-BODY-FILTER: empty-body Only applies to empty content bodies +s@^$@empty-body detected that there was no data@ diff --git a/tests/cts/client-body-filter-https/data/test1 b/tests/cts/client-body-filter-https/data/test1 new file mode 100644 index 00000000..b2ddb310 --- /dev/null +++ b/tests/cts/client-body-filter-https/data/test1 @@ -0,0 +1,61 @@ + + + +HTTPS +HTTP POST +client-body-filter + + + + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +HTTP/1.1 200 Connection established + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +https + + +Replace whole https request body with client-body-filter{blafasel-to-bumfidel} + + +proxy + + +-d blafasel --insecure https://%HOSTIP:%HTTPSPORT/%TESTNUMBER + + + + + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 8 +Content-Type: application/x-www-form-urlencoded + +bumfidel + + + diff --git a/tests/cts/client-body-filter-https/data/test10 b/tests/cts/client-body-filter-https/data/test10 new file mode 100644 index 00000000..f7c32a3a --- /dev/null +++ b/tests/cts/client-body-filter-https/data/test10 @@ -0,0 +1,57 @@ + + + +HTTPS +HTTP POST +client-body-filter + + + + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +HTTP/1.1 200 Connection established + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +https + + +Attempt to apply client-body-filter{blafasel-to-bumfidel} to client request that does not completely arrive in time. (XXX: Privoxy send a "Connection failed" message instead of a timeout message which would be more appropriate) + + +proxy + +# Sending the first request to appease the test framework. +# We mainly care about the second request where we overwrite the Content-Length +# header so curl sends less data than Privoxy expects. + +-s --insecure https://%HOSTIP:%HTTPSPORT/first-request/%TESTNUMBER --next -s --write-out '%{stderr}%{response_code}\n' --limit-rate 5000 -d "blafasel%repeat[100 x padding]%" -H "Content-Length: 8000" --insecure https://%HOSTIP:%HTTPSPORT/second-request/%TESTNUMBER + + + + + +400 + + + diff --git a/tests/cts/client-body-filter-https/data/test12 b/tests/cts/client-body-filter-https/data/test12 new file mode 100644 index 00000000..42d3312b --- /dev/null +++ b/tests/cts/client-body-filter-https/data/test12 @@ -0,0 +1,84 @@ + + + +HTTPS +HTTP POST +client-body-filter + + + + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your first request. + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your second request. + + + + + +HTTP/1.1 200 Connection established + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your first request. + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your second request. + + + + + +https + + +Attempt to apply client-body-filter{blafasel-to-bumfidel} to client request that is too large to buffer. + + +proxy + +# Sending the first request to appease the test framework. +# We mainly care about the second request which is too large for Privoxy to buffer it. + +--insecure https://%HOSTIP:%HTTPSPORT/first-request/%TESTNUMBER --next -d "blafasel%repeat[20000 x padding]%" --insecure https://%HOSTIP:%HTTPSPORT/second-request/%TESTNUMBER + + + + + +GET /first-request/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + +POST /second-request/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 140008 +Content-Type: application/x-www-form-urlencoded + +blafasel%repeat[20000 x padding]% + + + diff --git a/tests/cts/client-body-filter-https/data/test13 b/tests/cts/client-body-filter-https/data/test13 new file mode 100644 index 00000000..995c1ee5 --- /dev/null +++ b/tests/cts/client-body-filter-https/data/test13 @@ -0,0 +1,82 @@ + + + +HTTPS +HTTP POST +client-body-filter + + + + + +HTTP/1.1 200 OK +Connection: keep-alive +Content-Type: text/html +Content-Length: 21 + +Received your input. + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +HTTP/1.1 200 Connection established + +HTTP/1.1 200 OK +Connection: keep-alive +Content-Type: text/html +Content-Length: 21 + +Received your input. + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +https + + +Modify parts of the client body of a request on a reused connection with client-body-filter{blafasel-to-bumfidel} (based on test 2) + + +proxy + + +--insecure https://%HOSTIP:%HTTPSPORT/%TESTNUMBER --next -d "foo blafasel bar" --insecure https://%HOSTIP:%HTTPSPORT/%TESTNUMBER + + + + + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 16 +Content-Type: application/x-www-form-urlencoded + +foo bumfidel bar + + + diff --git a/tests/cts/client-body-filter-https/data/test14 b/tests/cts/client-body-filter-https/data/test14 new file mode 100644 index 00000000..517fb718 --- /dev/null +++ b/tests/cts/client-body-filter-https/data/test14 @@ -0,0 +1,80 @@ + + + +HTTPS +HTTP POST +client-body-filter + + + + + +HTTP/1.1 200 OK +Content-Length: 21 +Content-Type: text/html + +Received your input. + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +HTTP/1.1 200 Connection established + +HTTP/1.1 200 OK +Content-Length: 21 +Content-Type: text/html + +Received your input. + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +https + + +Applying client-body-filter{blafasel-to-bumfidel} to client request on a reused connection that is too large to read at once (based on test 5) + + +proxy + + +--insecure https://%HOSTIP:%HTTPSPORT/%TESTNUMBER --next -d "blafasel%repeat[5000 x padding]%" --insecure https://%HOSTIP:%HTTPSPORT/%TESTNUMBER + + + + + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 35008 +Content-Type: application/x-www-form-urlencoded + +bumfidel%repeat[5000 x padding]% + + + diff --git a/tests/cts/client-body-filter-https/data/test15 b/tests/cts/client-body-filter-https/data/test15 new file mode 100644 index 00000000..b36e8281 --- /dev/null +++ b/tests/cts/client-body-filter-https/data/test15 @@ -0,0 +1,72 @@ + + + +HTTPS +HTTP POST +client-body-filter + + + + + +HTTP/1.1 200 OK +Content-Length: 21 +Content-Type: text/html + +Received your input. + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +HTTP/1.1 200 Connection established + +HTTP/1.1 200 OK +Content-Length: 21 +Content-Type: text/html + +Received your input. + + + + + +https + + +Two filters applied to client request on a reused connection reusing the already filtered content (based on test 7) + + +proxy + + +--insecure https://%HOSTIP:%HTTPSPORT/bumfidel-to-tralala/%TESTNUMBER --next -d "blafasel" --insecure https://%HOSTIP:%HTTPSPORT/bumfidel-to-tralala/%TESTNUMBER + + + + + +GET /bumfidel-to-tralala/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + +POST /bumfidel-to-tralala/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 7 +Content-Type: application/x-www-form-urlencoded + +tralala + + + diff --git a/tests/cts/client-body-filter-https/data/test16 b/tests/cts/client-body-filter-https/data/test16 new file mode 100644 index 00000000..4e828be8 --- /dev/null +++ b/tests/cts/client-body-filter-https/data/test16 @@ -0,0 +1,71 @@ + + + +HTTPS +HTTP POST +client-body-filter + + + + + +HTTP/1.1 200 OK +Content-Length: 21 +Content-Type: text/html + +Received your input. + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +HTTP/1.1 200 Connection established + +HTTP/1.1 200 OK +Content-Length: 21 +Content-Type: text/html + +Received your input. + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +https + + +Attempt to apply client-body-filter{blafasel-to-bumfidel} to client request that does not completely arrive in time on a reused connection. (based on test 10) + + +proxy + +# Sending the first request to appease the test framework. +# We mainly care about the second request where we overwrite the Content-Length +# header so curl sends less data than Privoxy expects. + +-s --insecure https://%HOSTIP:%HTTPSPORT/first-request/%TESTNUMBER --next -s --write-out '%{stderr}%{response_code}\n' --limit-rate 5000 -d "blafasel%repeat[100 x padding]%" -H "Content-Length: 8000" --insecure https://%HOSTIP:%HTTPSPORT/second-request/%TESTNUMBER + + + + + +400 + + + diff --git a/tests/cts/client-body-filter-https/data/test17 b/tests/cts/client-body-filter-https/data/test17 new file mode 100644 index 00000000..57ba21c1 --- /dev/null +++ b/tests/cts/client-body-filter-https/data/test17 @@ -0,0 +1,81 @@ + + + +HTTPS +HTTP POST +client-body-filter + + + + + +HTTP/1.1 200 OK +Content-Length: 29 +Content-Type: text/html + +Received your first request. + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your second request. + + + + + +HTTP/1.1 200 Connection established + +HTTP/1.1 200 OK +Content-Length: 29 +Content-Type: text/html + +Received your first request. + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your second request. + + + + + +https + + +Attempt to apply client-body-filter{blafasel-to-bumfidel} to client request on reused connection that is too large to buffer. (based on test12) + + +proxy + +# We mainly care about the second request which is too large for Privoxy to buffer it. + +--insecure https://%HOSTIP:%HTTPSPORT/first-request/%TESTNUMBER --next -d "blafasel%repeat[20000 x padding]%" --insecure https://%HOSTIP:%HTTPSPORT/second-request/%TESTNUMBER + + + + + +GET /first-request/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* + +POST /second-request/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 140008 +Content-Type: application/x-www-form-urlencoded + +blafasel%repeat[20000 x padding]% + + + diff --git a/tests/cts/client-body-filter-https/data/test2 b/tests/cts/client-body-filter-https/data/test2 new file mode 100644 index 00000000..2a2bd3e9 --- /dev/null +++ b/tests/cts/client-body-filter-https/data/test2 @@ -0,0 +1,61 @@ + + + +HTTPS +HTTP POST +client-body-filter + + + + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +HTTP/1.1 200 Connection established + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +https + + +Modify parts of the client body with client-body-filter{blafasel-to-bumfidel} + + +proxy + + +-d "foo blafasel bar" --insecure https://%HOSTIP:%HTTPSPORT/%TESTNUMBER + + + + + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 16 +Content-Type: application/x-www-form-urlencoded + +foo bumfidel bar + + + diff --git a/tests/cts/client-body-filter-https/data/test3 b/tests/cts/client-body-filter-https/data/test3 new file mode 100644 index 00000000..429127cd --- /dev/null +++ b/tests/cts/client-body-filter-https/data/test3 @@ -0,0 +1,61 @@ + + + +HTTPS +HTTP POST +client-body-filter + + + + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +HTTP/1.1 200 Connection established + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +https + + +Apply client-body-filter{blafasel-to-bumfidel} to request that does not contain blafasel + + +proxy + + +-d "foo bar" --insecure https://%HOSTIP:%HTTPSPORT/%TESTNUMBER + + + + + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 7 +Content-Type: application/x-www-form-urlencoded + +foo bar + + + diff --git a/tests/cts/client-body-filter-https/data/test4 b/tests/cts/client-body-filter-https/data/test4 new file mode 100644 index 00000000..48165542 --- /dev/null +++ b/tests/cts/client-body-filter-https/data/test4 @@ -0,0 +1,63 @@ + + + +HTTPS +HTTP POST +client-body-filter + + + + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html + +Received your input. + +Will keep the connection open despite the "Connection: Close" header. + + + + + +HTTP/1.1 200 Connection established + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html + +Received your input. + +Will keep the connection open despite the "Connection: Close" header. + + + + + +https + + +Using client-body-filter{blafasel-to-bumfidel} with server connection that times out after delivering the response + + +proxy + + +-d "blafasel" --insecure https://%HOSTIP:%HTTPSPORT/%TESTNUMBER + + + + + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 8 +Content-Type: application/x-www-form-urlencoded + +bumfidel + + + diff --git a/tests/cts/client-body-filter-https/data/test5 b/tests/cts/client-body-filter-https/data/test5 new file mode 100644 index 00000000..6a253fed --- /dev/null +++ b/tests/cts/client-body-filter-https/data/test5 @@ -0,0 +1,61 @@ + + + +HTTPS +HTTP POST +client-body-filter + + + + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +HTTP/1.1 200 Connection established + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +https + + +Applying client-body-filter{blafasel-to-bumfidel} to client request that is too large to read at once + + +proxy + + +-d "blafasel%repeat[5000 x padding]%" --insecure https://%HOSTIP:%HTTPSPORT/%TESTNUMBER + + + + + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 35008 +Content-Type: application/x-www-form-urlencoded + +bumfidel%repeat[5000 x padding]% + + + diff --git a/tests/cts/client-body-filter-https/data/test6 b/tests/cts/client-body-filter-https/data/test6 new file mode 100644 index 00000000..305d2989 --- /dev/null +++ b/tests/cts/client-body-filter-https/data/test6 @@ -0,0 +1,61 @@ + + + +HTTPS +HTTP POST +client-body-filter + + + + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +HTTP/1.1 200 Connection established + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +https + + +Applying client-body-filter{blafasel-to-bumfidel} to client request that is too large to be read at once and arrives slowly + + +proxy + + +--limit-rate 4k -d "blafasel%repeat[5000 x padding]%" --insecure https://%HOSTIP:%HTTPSPORT/%TESTNUMBER + + + + + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 35008 +Content-Type: application/x-www-form-urlencoded + +bumfidel%repeat[5000 x padding]% + + + diff --git a/tests/cts/client-body-filter-https/data/test7 b/tests/cts/client-body-filter-https/data/test7 new file mode 100644 index 00000000..2ce09245 --- /dev/null +++ b/tests/cts/client-body-filter-https/data/test7 @@ -0,0 +1,61 @@ + + + +HTTPS +HTTP POST +client-body-filter + + + + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +HTTP/1.1 200 Connection established + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +https + + +Two filters applied to client request reusing the already filtered content + + +proxy + + +-d "blafasel" --insecure https://%HOSTIP:%HTTPSPORT/bumfidel-to-tralala/%TESTNUMBER + + + + + +POST /bumfidel-to-tralala/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 7 +Content-Type: application/x-www-form-urlencoded + +tralala + + + diff --git a/tests/cts/client-body-filter-https/data/test8 b/tests/cts/client-body-filter-https/data/test8 new file mode 100644 index 00000000..2a129870 --- /dev/null +++ b/tests/cts/client-body-filter-https/data/test8 @@ -0,0 +1,61 @@ + + + +HTTPS +HTTP POST +client-body-filter + + + + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +HTTP/1.1 200 Connection established + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html +X-Connection: swsclose + +Received your input. + + + + + +https + + +Three filters applied to client request reusing the already filtered content. Last filter does not modify content. + + +proxy + + +-d "blafasel" --insecure https://%HOSTIP:%HTTPSPORT/bumfidel-to-tralala/empty-body/%TESTNUMBER + + + + + +POST /bumfidel-to-tralala/empty-body/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Length: 7 +Content-Type: application/x-www-form-urlencoded + +tralala + + + diff --git a/tests/cts/client-body-filter-https/data/test9 b/tests/cts/client-body-filter-https/data/test9 new file mode 100644 index 00000000..80ea75e4 --- /dev/null +++ b/tests/cts/client-body-filter-https/data/test9 @@ -0,0 +1,63 @@ + + + +HTTPS +HTTP POST +client-body-filter +# This test currently doesn't work as Privoxy truncates the request. +# Sending no Content-Length header is an error but truncating the +# request still doesn't seem ideal. Probably Privoxy should reject +# the request instead of forwarding it. +skip + + + + + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html + +Received your input. + + + + + +HTTP/1.1 200 Connection established + +HTTP/1.1 200 OK +Connection: close +Content-Type: text/html + +Received your input. + + + + + +https + + +Attempt to apply client-body-filter{blafasel-to-bumfidel} to client request without Content-Length header + + +proxy + + +--limit-rate 1000 -d "blafasel%repeat[5000 x padding]%" -H "Content-Length:" --insecure https://%HOSTIP:%HTTPSPORT/%TESTNUMBER + + + + + +POST /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +User-Agent: curl/%VERSION +Accept: */* +Content-Type: application/x-www-form-urlencoded + +bumfidel%repeat[5000 x padding]% + + + diff --git a/tests/cts/client-body-filter-https/privoxy.conf b/tests/cts/client-body-filter-https/privoxy.conf new file mode 100644 index 00000000..3a6eecff --- /dev/null +++ b/tests/cts/client-body-filter-https/privoxy.conf @@ -0,0 +1,37 @@ +listen-address 127.0.0.1:9119 + +ca-directory ../ca-directory +ca-cert-file privoxy-test-cacert.crt +ca-key-file privoxy-test-cakey.pem +ca-password blafasel +# We don't check certificate anyway +trusted-cas-file privoxy-test-cacert.crt + +certificate-directory ../certs + +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 + +actionsfile ../blocked-https-requests/https-inspection.action +actionsfile ../client-body-filter/client-body-filter.action +filterfile ../client-body-filter/client-body-filter.filter + +socket-timeout 3 + +templdir ../../../templates/ + +# Reduce buffer limit so tests can reach it sooner. +buffer-limit 100 + +keep-alive-timeout 10 +default-server-timeout 10 -- 2.39.2