From: Fabian Keil <fk@fabiankeil.de>
Date: Fri, 5 Mar 2021 07:19:04 +0000 (+0100)
Subject: Add test scenario pac-file-delivery
X-Git-Tag: v_4_0_0~95
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/user-manual/developer-manual/faq/static/gitweb.js?a=commitdiff_plain;h=ce6260ffa119cf08767e99dad580a1c4767c8c4e;p=privoxy.git

Add test scenario pac-file-delivery

Sponsored by: Privoxy project funds collected at SPI
---

diff --git a/tests/cts/pac-file-delivery/data/test1 b/tests/cts/pac-file-delivery/data/test1
new file mode 100644
index 00000000..1967870f
--- /dev/null
+++ b/tests/cts/pac-file-delivery/data/test1
@@ -0,0 +1,50 @@
+<testcase>
+<info>
+<keywords>
+HTTPS
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Connection: close
+Content-Type: text/html
+Content-Length: 18
+
+Here's your data.
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+function FindProxyForURL(url, host) {
+    var proxy = "PROXY 127.0.0.1:9119; DIRECT";
+    var direct = "DIRECT";
+    if (isPlainHostName(host)) {
+        return direct;
+    }
+    if (url.substring(0, 4) == "ftp:" || url.substring(0, 6) == "rsync:") {
+        return direct;
+    }
+    return proxy;
+}
+</data>
+</proxy-reply>
+
+<client>
+<server>
+none
+</server>
+<name>
+CGI request for PAC file
+</name>
+<command option="no-include">
+http://config.privoxy.org/wpad.dat
+</command>
+</client>
+
+<verify>
+</verify>
+</testcase>
diff --git a/tests/cts/pac-file-delivery/privoxy.conf b/tests/cts/pac-file-delivery/privoxy.conf
new file mode 100644
index 00000000..00398651
--- /dev/null
+++ b/tests/cts/pac-file-delivery/privoxy.conf
@@ -0,0 +1,18 @@
+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
+
+templdir ../../../templates
+
+keep-alive-timeout 15