--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Connection: close
+Content-Type: text/html
+Content-Length: 29
+
+Not actually used.
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 400 Malformed request after rewriting
+Content-Type: text/plain
+Connection: close
+
+Bad request. Messed up with header filters.
+</data>
+</proxy-reply>
+
+
+<client>
+<server>
+none
+</server>
+<name>
+Rewrite behind the client's back: invalid upgrade to https
+</name>
+<command>
+http://%HOSTIP/%TESTNUMBER-upgrade-to-https
+</command>
+</client>
+
+<verify>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Content-Length: 9
+
+Blafasel
+</data>
+</reply>
+
+
+<client>
+<server>
+http
+</server>
+<name>
+Rewrite path behind the client's back
+</name>
+<command>
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER-remove-this
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Content-Length: 9
+
+Blafasel
+</data>
+</reply>
+
+
+<client>
+<server>
+http
+</server>
+<name>
+Rewrite host behind the client's back
+</name>
+<command>
+http://www.example.org/%TESTNUMBER-%HOSTIP:%HTTPPORT
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /%TESTNUMBER HTTP/1.1\r
+Host: www.example.org\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+Connection: close\r
+\r
+</protocol>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Content-Length: 9
+
+Blafasel
+</data>
+</reply>
+
+
+<client>
+<server>
+http
+</server>
+<name>
+Client header filter that doesn't match anything. According to Valgrind it triggers a "Conditional jump or move depends on uninitialised value(s)"
+</name>
+<command>
+http:///%HOSTIP:%HTTPPORT/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+Connection: close\r
+\r
+</protocol>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Connection: close
+Content-Type: text/html
+Content-Length: 29
+
+Not actually used.
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 400 Malformed request after rewriting
+Content-Type: text/plain
+Connection: close
+
+Bad request. Messed up with header filters.
+</data>
+</proxy-reply>
+
+<client>
+<server>
+none
+</server>
+<name>
+Rewrite behind the client's back: unsupported http version
+</name>
+<command>
+http://%HOSTIP/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+</verify>
+</testcase>
--- /dev/null
+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
+
+actionsfile rewrites.action
+filterfile rewrites.filter
--- /dev/null
+{+client-header-filter{http-to-https}}
+/1-upgrade-to-https
+
+{+client-header-filter{truncate-path}}
+/2-remove-this
+
+{+client-header-filter{rewrite-host}}
+/3
+
+{+client-header-filter{non-matching-rewriter}}
+/4
+
+{+client-header-filter{invalid-http-version}}
+/5
--- /dev/null
+CLIENT-HEADER-FILTER: http-to-https Upgrade http requests to https behind the client's back. Not actually supported.
+s@^(\w+)\s+http://@$1 https://@i
+
+CLIENT-HEADER-FILTER: truncate-path Removes '-remove-this' from the path
+s@(/\d)-remove-this (HTTP/1.1)@$1 $2@i
+
+CLIENT-HEADER-FILTER: rewrite-host Replaces the host with the one specified in the path
+s@GET .*/(\d)-(\d+\.\d+\.\d+\.\d+\:\d+) (HTTP/1.1)@GET http://$2/$1 $3@i
+
+# Results in Conditional jump or move depends on uninitialised value(s)?
+CLIENT-HEADER-FILTER: non-matching-rewriter Does not actually match
+s@/-@@
+
+CLIENT-HEADER-FILTER: invalid-http-version Rewrites the request line with an invalid HTTP version
+s@HTTP/1.1@HTTP/9000@
+