From: Fabian Keil <fk@fabiankeil.de> Date: Tue, 19 Jan 2021 17:54:50 +0000 (+0100) Subject: Add test scenario content-filters X-Git-Tag: v_4_0_0~100 X-Git-Url: http://www.privoxy.org/gitweb/%22https:/faq/@default-cgi@/developer-manual/static/diff?a=commitdiff_plain;h=1773ba22356d917738727dc1d530ac7e6de73fa6;p=privoxy.git Add test scenario content-filters Sponsored by: Privoxy project funds collected at SPI --- diff --git a/tests/cts/content-filters/content-filters.action b/tests/cts/content-filters/content-filters.action new file mode 100644 index 00000000..25de2530 --- /dev/null +++ b/tests/cts/content-filters/content-filters.action @@ -0,0 +1,95 @@ +{+filter{js-annoyances}} +/js-annoyances/ + +{+filter{js-events}} +/js-events/ + +{+filter{html-annoyances}} +/html-annoyances/ + +{+filter{content-cookies}} +/content-cookies/ + +{+filter{refresh-tags}} +/refresh-tags/ + +{+filter{unsolicited-popups}} +/unsolicited-popups/ + +{+filter{all-popups}} +/all-popups/ + +{+filter{img-reorder}} +/img-reorder/ + +{+filter{banners-by-size}} +/banners-by-size/ + +{+filter{banners-by-link}} +/banners-by-link/ + +{+filter{webbugs}} +/webbugs/ + +{+filter{tiny-textforms}} +/tiny-textforms/ + +{+filter{jumping-windows}} +/jumping-windows/ + +{+filter{frameset-borders}} +/frameset-borders/ + +{+filter{iframes}} +/iframes/ + +{+filter{demoronizer}} +/demoronizer/ + +{+filter{shockwave-flash}} +/shockwave-flash/ + +{+filter{quicktime-kioskmode}} +/quicktime-kioskmode/ + +{+filter{fun}} +/fun/ + +{+filter{crude-parental}} +/crude-parental/ + +{+filter{ie-exploits}} +/ie-exploits/ + +{+filter{site-specifics}} +/site-specifics/ + +{+filter{no-ping}} +/no-ping/ + +{+filter{allow-autocompletion}} +/allow-autocompletion/ + +{+filter{github}} +/github/ + +{+filter{imdb}} +/imdb/ + +{+filter{google}} +/google/ + +{+filter{google}} +/google/ + +{+filter{yahoo}} +/yahoo/ + +{+filter{msn}} +/msn/ + +{+filter{blogspot}} +/blogspot/ + +{+filter{sourceforge}} +/sourceforge/ diff --git a/tests/cts/content-filters/data/test1 b/tests/cts/content-filters/data/test1 new file mode 100644 index 00000000..e9713072 --- /dev/null +++ b/tests/cts/content-filters/data/test1 @@ -0,0 +1,229 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter js-annoyances +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the js-annoyances filter should modify: + +# pcrs command 1: + +blafasel.referrer + +# pcrs command 2: + +bla bla bla this.defaultstatus = "hoho" x y z +bla bla bla window.status = "whatever" x y z + +# pcrs command 3: + +this.status = blafasel; +window.defaultstatus= dieda; + +# pcrs command 4: + +<body onunload="box('query').focus();"> + +# pcrs command 5: + +<script + window.onunload="do.something()" +</script> + +# pcrs command 6: + +open (blafasel resizable="no"); +open(blafasel resizable='0'); + +# pcrs command 7: + +open(blafasel location="no") +open(blafasel location='0') + +# pcrs command 8: + +open(blafasel status="no") +open(blafasel status='0') + +# pcrs command 9: + +open(blafasel scrolling="no") +open(blafasel scrollbars='0') + +# pcrs command 10: + +open(blafasel menubar="no") +open(blafasel menubar='0') + +# pcrs command 11: + +open(blafasel toolbar="no") +open(blafasel toolbar='0') + +# pcrs command 12: + +open(blafasel directories="no") +open(blafasel directories='0') + +# pcrs command 13: + +open(blafasel fullscreen="no") +open(blafasel fullscreen='0') + +# pcrs command 14: + +open(blafasel alwaysraised="yes") +open(blafasel alwayslowered='yes') + +# pcrs command 15: + +open(blafasel z-lock="yes") +open(blafasel zlock='yes') + +# pcrs command 16: + +open(blafasel hotkeys="yes") +open(blafasel hotkeys='1') + +# pcrs command 17: + +open(blafasel titlebar="no") +open(blafasel titlebar='0') +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 1503 + +# Here are some strings the js-annoyances filter should modify: + +# pcrs command 1: + +false.toString() + +# pcrs command 2: + +bla bla bla this.defaultstatus = (typeof(this.href) != 'undefined')?("hoho" + ' URL: ' + this.href):(this.defaultstatus) x y z +bla bla bla window.status = (typeof(this.href) != 'undefined')?("whatever" + ' URL: ' + this.href):(window.status) x y z + +# pcrs command 3: + + + + +# pcrs command 4: + +<body never="box('query').focus();"> + +# pcrs command 5: + +<script + never="do.something()" +</script> + +# pcrs command 6: + +open (blafasel resizable="yes"); +open(blafasel resizable='yes'); + +# pcrs command 7: + +open(blafasel location="yes") +open(blafasel location='yes') + +# pcrs command 8: + +open(blafasel status="yes") +open(blafasel status='yes') + +# pcrs command 9: + +open(blafasel scrolling="auto") +open(blafasel scrollbars='auto') + +# pcrs command 10: + +open(blafasel menubar="yes") +open(blafasel menubar='yes') + +# pcrs command 11: + +open(blafasel toolbar="yes") +open(blafasel toolbar='yes') + +# pcrs command 12: + +open(blafasel directories="yes") +open(blafasel directories='yes') + +# pcrs command 13: + +open(blafasel fullscreen="no") +open(blafasel fullscreen='0') + +# pcrs command 14: + +open(blafasel alwaysraised="no") +open(blafasel alwayslowered='no') + +# pcrs command 15: + +open(blafasel z-lock="no") +open(blafasel zlock='no') + +# pcrs command 16: + +open(blafasel hotkeys="no") +open(blafasel hotkeys='no') + +# pcrs command 17: + +open(blafasel titlebar="yes") +open(blafasel titlebar='yes') +</data> +</proxy-reply> + + +<client> +<server> +http +</server> +<name> ++filter{js-annoyances} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/js-annoyances/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /js-annoyances/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test10 b/tests/cts/content-filters/data/test10 new file mode 100644 index 00000000..e5c35643 --- /dev/null +++ b/tests/cts/content-filters/data/test10 @@ -0,0 +1,108 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter banners-by-link +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here is some HTML that the banners-by-link filter should modify: + +# pcrs command 1: + +<a href="http://www.example.org/adclick/blafasel"><img src="https://www.example.org/img-link-target" width="123" height="345"> +<a href="http://www.example.org/advert/blafasel"><img src="https://www.example.org/img-link-target" width="123" height="345"> +<a href="http://atwola.com/link"><img src="https://www.example.org/img-link-target" width="123" height="345"> +<a href="http://atwola.com/redir"><img src="https://www.example.org/img-link-target" width="123" height="345"> +<a href="http://doubleclick.net/jump/"><img src="https://www.example.org/img-link-target" width="123" height="345"> +<a href="http://www.example.org/blafasel/counter"><img src="https://www.example.org/img-link-target" width="123" height="345"> +<a href="http://www.example.org/blafasel/tracker"><img src="https://www.example.org/img-link-target" width="123" height="345"> +<a href="http://www.example.org/blafasel/keep-me&type=tracker"><img src="https://www.example.org/img-link-target" width="123" height="345"> +<a href="http://adlog.pl"><img src="https://www.example.org/img-link-target" width="123" height="345"> + +# pcrs command 2: + +<a href="http://www.example.org/adclick/blafasel"><img src="https://www.example.org/img-link-target"> +<a href="http://www.example.org/advert/blafasel"><img src="https://www.example.org/img-link-target"> +<a href="http://atwola.com/link"><img src="https://www.example.org/img-link-target"> +<a href="http://atwola.com/redir"><img src="https://www.example.org/img-link-target"> +<a href="http://doubleclick.net/jump/"><img src="https://www.example.org/img-link-target"> +<a href="http://www.example.org/blafasel/counter"><img src="https://www.example.org/img-link-target"> +<a href="http://www.example.org/blafasel/tracker"><img src="https://www.example.org/img-link-target"> +<a href="http://www.example.org/blafasel/keep-me&type=tracker"><img src="https://www.example.org/img-link-target"> +<a href="http://adlog.pl"><img src="https://www.example.org/img-link-target"> +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 3256 + +# Here is some HTML that the banners-by-link filter should modify: + +# pcrs command 1: + +<img width="123" height="345" src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed https://www.example.org/img-link-target by link to http://www.example.org/adclick/blafasel"> +<img width="123" height="345" src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed https://www.example.org/img-link-target by link to http://www.example.org/advert/blafasel"> +<img width="123" height="345" src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed https://www.example.org/img-link-target by link to http://atwola.com/link"> +<img width="123" height="345" src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed https://www.example.org/img-link-target by link to http://atwola.com/redir"> +<img width="123" height="345" src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed https://www.example.org/img-link-target by link to http://doubleclick.net/jump/"> +<img width="123" height="345" src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed https://www.example.org/img-link-target by link to http://www.example.org/blafasel/counter"> +<img width="123" height="345" src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed https://www.example.org/img-link-target by link to http://www.example.org/blafasel/tracker"> +<a href="http://www.example.org/blafasel/keep-me&type=tracker"><img src="https://www.example.org/img-link-target" width="123" height="345"> +<img width="123" height="345" src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed https://www.example.org/img-link-target by link to http://adlog.pl"> + +# pcrs command 2: + +<img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed https://www.example.org/img-link-target by link to http://www.example.org/adclick/blafasel"> +<img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed https://www.example.org/img-link-target by link to http://www.example.org/advert/blafasel"> +<img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed https://www.example.org/img-link-target by link to http://atwola.com/link"> +<img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed https://www.example.org/img-link-target by link to http://atwola.com/redir"> +<img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed https://www.example.org/img-link-target by link to http://doubleclick.net/jump/"> +<img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed https://www.example.org/img-link-target by link to http://www.example.org/blafasel/counter"> +<img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed https://www.example.org/img-link-target by link to http://www.example.org/blafasel/tracker"> +<a href="http://www.example.org/blafasel/keep-me&type=tracker"><img src="https://www.example.org/img-link-target"> +<img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed https://www.example.org/img-link-target by link to http://adlog.pl"> +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{banners-by-link} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/banners-by-link/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /banners-by-link/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test11 b/tests/cts/content-filters/data/test11 new file mode 100644 index 00000000..277ea886 --- /dev/null +++ b/tests/cts/content-filters/data/test11 @@ -0,0 +1,102 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter webbugs +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here is some HTML that the webbugs filter should squash: + +<img width="0" height="0" src="http://www.example.org/tracker.cgi"> +<img width='0' height='0' src="http://www.example.org/tracker.cgi"> +<img height="0" width="0" src="http://www.example.org/tracker.cgi"> +<img height='0' width='0' src="http://www.example.org/tracker.cgi"> + +<img width="0" height="1" src="http://www.example.org/tracker.cgi"> +<img width='0' height='1' src="http://www.example.org/tracker.cgi"> +<img height="0" width="1" src="http://www.example.org/tracker.cgi"> +<img height='0' width='1' src="http://www.example.org/tracker.cgi"> + +<img width="1" height="0" src="http://www.example.org/tracker.cgi"> +<img width='1' height='0' src="http://www.example.org/tracker.cgi"> +<img height="1" width="0" src="http://www.example.org/tracker.cgi"> +<img height='1' width='0' src="http://www.example.org/tracker.cgi"> + +<img width="1" height="1" src="http://www.example.org/tracker.cgi"> +<img width='1' height='1' src="http://www.example.org/tracker.cgi"> +<img height="1" width="1" src="http://www.example.org/tracker.cgi"> +<img height='1' width='1' src="http://www.example.org/tracker.cgi"> + +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 80 + +# Here is some HTML that the webbugs filter should squash: + + + + + + + + + + + + + + + + + + + + + +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{webbugs} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/webbugs/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /webbugs/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test12 b/tests/cts/content-filters/data/test12 new file mode 100644 index 00000000..a7a7fd65 --- /dev/null +++ b/tests/cts/content-filters/data/test12 @@ -0,0 +1,92 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter tiny-textforms +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some tiny textforms the tiny-textforms filter should filter: + +# pcrs command 1: + +<textarea rows="10" cols="10"> +<textarea cols="10" rows="10"> +<textarea rows='5' cols="5"> +<textarea cols='7' rows='7'> + +<!-- The filter actual makes large forms tynier ... --> +<textarea rows="100" cols="100"> +<textarea cols="1000" rows="1000"> + +# pcrs command 2: + +<textarea wrap="hard"> +<textarea wrap='hard'> +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 379 + +# Here are some tiny textforms the tiny-textforms filter should filter: + +# pcrs command 1: + +<textarea rows="40" cols="80"> +<textarea rows="40" cols="80"> +<textarea rows="40" cols="80"> +<textarea rows='40' cols='80'> + +<!-- The filter actual makes large forms tynier ... --> +<textarea rows="40" cols="80"> +<textarea rows="40" cols="80"> + +# pcrs command 2: + +<textarea > +<textarea > +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{tiny-textforms} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/tiny-textforms/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /tiny-textforms/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test13 b/tests/cts/content-filters/data/test13 new file mode 100644 index 00000000..3f4c027e --- /dev/null +++ b/tests/cts/content-filters/data/test13 @@ -0,0 +1,84 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter jumping-windows +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the jumping-windows filter should filter: + ++window.moveto( ++this.moveto( ++self.moveto( + ++window.moveby( ++this.moveby( ++self.moveby( + ++window.resizeto( ++this.resizeto( ++self.resizeto( +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 177 + +# Here are some strings the jumping-windows filter should filter: + ++''.concat( ++''.concat( ++''.concat( + ++''.concat( ++''.concat( ++''.concat( + ++''.concat( ++''.concat( ++''.concat( +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{jumping-windows} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/jumping-windows/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /jumping-windows/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test14 b/tests/cts/content-filters/data/test14 new file mode 100644 index 00000000..18563bf4 --- /dev/null +++ b/tests/cts/content-filters/data/test14 @@ -0,0 +1,118 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter frameset-borders +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the frameset-borders filter should filter: + +# pcrs command 1: + +<frameset framespacing="no" +<frameset framespacing='0' + +# pcrs command 2: + +<frameset frameborder="no" +<frameset frameborder='0' + +# pcrs command 3: + +<frameset border="no" +<frameset border='0' + +# pcrs command 4: + +<frameset noresize + +# pcrs command 5: + +<frame frameborder="no" +<frame frameborder='0' + +# pcrs command 6: + +<frame scrolling="no" +<frame scrolling='0' +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 309 + +# Here are some strings the frameset-borders filter should filter: + +# pcrs command 1: + +<frameset +<frameset + +# pcrs command 2: + +<frameset +<frameset + +# pcrs command 3: + +<frameset +<frameset + +# pcrs command 4: + +<frameset noresize + +# pcrs command 5: + +<frame +<frame frame + +# pcrs command 6: + +<frame +<frame +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{frameset-borders} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/frameset-borders/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /frameset-borders/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test15 b/tests/cts/content-filters/data/test15 new file mode 100644 index 00000000..6043a3e7 --- /dev/null +++ b/tests/cts/content-filters/data/test15 @@ -0,0 +1,80 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter iframes +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some iframes the iframes filter should filter: + +<iframe src="https://www.example.org/ads" title="Some ads for you"></iframe> + +<iframe + src="https://www.example.org/ads" + title="Some ads for you"></iframe> + +<iframe src="https://www.example.org/ads"> +</iframe> + +<iframe src="https://www.example.org/ads"> +</iframe> +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 266 + +# Here are some iframes the iframes filter should filter: + +<!-- iframe removed by Privoxy's iframe filter --> + +<!-- iframe removed by Privoxy's iframe filter --> + +<!-- iframe removed by Privoxy's iframe filter --> + +<!-- iframe removed by Privoxy's iframe filter --> +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{iframes} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/iframes/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /iframes/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test16 b/tests/cts/content-filters/data/test16 new file mode 100644 index 00000000..251a31bc --- /dev/null +++ b/tests/cts/content-filters/data/test16 @@ -0,0 +1,216 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter demoronizer +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some supposedly moronic byte sequences the demoronizer filter should filter: + +# pcrs command 1: + + +{ +ÿ + +# pcrs command 2: + +%hex[ %E2%80%94 ]hex% + +# pcrs command 3: + +%hex[ %82 ]hex% + +# pcrs command 4 (commented out, no change expected): + +%hex[ %83 ]hex% + +# pcrs command 5: + +%hex[ %84 ]hex% + +# pcrs command 6: + +%hex[ %85 ]hex% + +# pcrs command 7 (commented out, no change expected): + +%hex[ %88 ]hex% + +# pcrs command 8 (commented out, no change expected): + +%hex[ %89 ]hex% + +# pcrs command 9: + +%hex[ %8B ]hex% + +# pcrs command 10: + +%hex[ %8C ]hex% + +# pcrs command 11: + +%hex[ %91 ]hex% + +# pcrs command 12: + +%hex[ %92 ]hex% + +# pcrs command 13: + +%hex[ %92%94 ]hex% + +# pcrs command 14: + +%hex[ %95 ]hex% + +# pcrs command 15: + +%hex[ %96 ]hex% + +# pcrs command 16: + +%hex[ %97 ]hex% + +# pcrs command 17 (commented out, no change expected): + +%hex[ %98 ]hex% + +# pcrs command 18 (commented out, no change expected): + +%hex[ %99 ]hex% + +# pcrs command 19 + +%hex[ %9B ]hex%/> +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 771 + +# Here are some supposedly moronic byte sequences the demoronizer filter should filter: + +# pcrs command 1: + + +{ +ÿ + +# pcrs command 2: + + -- + +# pcrs command 3: + + , + +# pcrs command 4 (commented out, no change expected): + +%hex[ %83 ]hex% + +# pcrs command 5: + + ,, + +# pcrs command 6: + + ... + +# pcrs command 7 (commented out, no change expected): + +%hex[ %88 ]hex% + +# pcrs command 8 (commented out, no change expected): + +%hex[ %89 ]hex% + +# pcrs command 9: + + < + +# pcrs command 10: + + Oe + +# pcrs command 11: + + ` + +# pcrs command 12: + + ' + +# pcrs command 13: + + '" + +# pcrs command 14: + + · + +# pcrs command 15: + + - + +# pcrs command 16: + + -- + +# pcrs command 17 (commented out, no change expected): + +%hex[ %98 ]hex% + +# pcrs command 18 (commented out, no change expected): + +%hex[ %99 ]hex% + +# pcrs command 19 + + > /> +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{demoronizer} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/demoronizer/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /demoronizer/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test17 b/tests/cts/content-filters/data/test17 new file mode 100644 index 00000000..da388892 --- /dev/null +++ b/tests/cts/content-filters/data/test17 @@ -0,0 +1,138 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter shockwave-flash +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the shockwave-flash filter should filter: + +# pcrs command 1: + +<object blafasel macromedia tralala>bla bla bla</object> + +<object +blafasel +macromedia +tralala +>bla bla bla</object> + +<Object + blafasel + macromedia + tralala + > bla bla bla +</Object> + +# pcrs command 2: + +<embed blafasel application/x-shockwave-flash bumfidel>xyz</embed> + +<embed blafasel +application/x-shockwave-flash +bumfidel>xyz</embed> + +<embed blafasel + application/x-shockwave-flash + bumfidel> + +<embed blafasel src="https://example.org/flash-me.swf"> + +XXX: The following strings don't get filter but probably should be: + +<embed +blafasel + src="https://example.org/flash-me.swf"> + +<EMBED +blafasel + src="https://example.org/flash-me.swf"> +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 739 + +# Here are some strings the shockwave-flash filter should filter: + +# pcrs command 1: + +<!-- Squished Shockwave Object --> + +<object +blafasel +macromedia +tralala +>bla bla bla</object> + +<Object + blafasel + macromedia + tralala + > bla bla bla +</Object> + +# pcrs command 2: + +<!-- Squished Shockwave Flash Embed -->xyz</embed> + +<!-- Squished Shockwave Flash Embed -->xyz</embed> + +<!-- Squished Shockwave Flash Embed --> + +<!-- Squished Shockwave Flash Embed --> + +XXX: The following strings don't get filter but probably should be: + +<embed +blafasel + src="https://example.org/flash-me.swf"> + +<EMBED +blafasel + src="https://example.org/flash-me.swf"> +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{shockwave-flash} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/shockwave-flash/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /shockwave-flash/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test18 b/tests/cts/content-filters/data/test18 new file mode 100644 index 00000000..9d57c16c --- /dev/null +++ b/tests/cts/content-filters/data/test18 @@ -0,0 +1,76 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter quicktime-kioskmode +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the quicktime-kioskmode filter should filter: + +s/(<embed\s+[^>]*)kioskmode\s*=\s*(["']?)true\2/$1/ig + +<embed blafasel kioskmode="true"> + +<embed blafasel kioskmode='true'> + +<embed blafasel kioskmode='true' tralala> +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 190 + +# Here are some strings the quicktime-kioskmode filter should filter: + +s/(<embed\s+[^>]*)kioskmode\s*=\s*(["']?)true\2/$1/ig + +<embed blafasel > + +<embed blafasel > + +<embed blafasel tralala> +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{quicktime-kioskmode} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/quicktime-kioskmode/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /quicktime-kioskmode/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test19 b/tests/cts/content-filters/data/test19 new file mode 100644 index 00000000..623c5057 --- /dev/null +++ b/tests/cts/content-filters/data/test19 @@ -0,0 +1,116 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter fun +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the fun filter should filter: + +# pcrs command 1: + +Microsoft + +# pcrs command 1 should not break URLs: + +https://www.microsoft.com/ + +# pcrs command 2: + +Our great product is + industry leading + world-leading + cutting edge + customer-focused + market driven + award winning + high performance + solutions-based + unmatched + unparalleled + and unrivalled. + +# pcrs command 3: + +Medieninformatik + medien +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 1456 + +# Here are some strings the fun filter should filter: + +# pcrs command 1: + +MicroSuck + +# pcrs command 1 should not break URLs: + +https://www.microsoft.com/ + +# pcrs command 2: + +Our great product is + industry leading<sup><font color="red"><b>Bingo!</b></font></sup> + world-leading<sup><font color="red"><b>Bingo!</b></font></sup> + cutting edge<sup><font color="red"><b>Bingo!</b></font></sup> + customer-focused<sup><font color="red"><b>Bingo!</b></font></sup> + market driven<sup><font color="red"><b>Bingo!</b></font></sup> + award winning<sup><font color="red"><b>Bingo!</b></font></sup> + high performance<sup><font color="red"><b>Bingo!</b></font></sup> + solutions-based<sup><font color="red"><b>Bingo!</b></font></sup> + unmatched<sup><font color="red"><b>Bingo!</b></font></sup> + unparalleled<sup><font color="red"><b>Bingo!</b></font></sup> + and unrivalled<sup><font color="red"><b>Bingo!</b></font></sup> . + +# pcrs command 3: + +Mädcheninformatik + mädchen +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{fun} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/fun/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /fun/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test2 b/tests/cts/content-filters/data/test2 new file mode 100644 index 00000000..30be85f5 --- /dev/null +++ b/tests/cts/content-filters/data/test2 @@ -0,0 +1,129 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter js-annoyances +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the js-events filter should modify: + +# pcrs command 1: + +onmouseover +onmouseout +onmousedown +onmouseup +onmousemove + +event.mouseover +event.mouseout +event.mousedown +event.mouseup +event.mousemove + +onload +onunload +oncontextmenu +onselectstart + +event.load +event.unload +event.contextmenu +event.selectstart + +# pcrs command 2: + +alert ( +confirm ( + +# pcrs command 3: + +settimeout( +setinterval( +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 263 + +# Here are some strings the js-events filter should modify: + +# pcrs command 1: + +never +never +never +never +never + +never +never +never +never +never + +never +never +never +never + +never +never +never +never + +# pcrs command 2: + +concat( +concat( + +# pcrs command 3: + +concat( +concat( +</data> +</proxy-reply> + + +<client> +<server> +http +</server> +<name> ++filter{js-events} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/js-events/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /js-events/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test200 b/tests/cts/content-filters/data/test200 new file mode 100644 index 00000000..39792a1b --- /dev/null +++ b/tests/cts/content-filters/data/test200 @@ -0,0 +1,62 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter crude-parental +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# This is a site which contains the word sex which should trigger the crude-parental filter: + +Here it comes again: SEX!!!! +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 170 + +<html><head><title>Blocked</title></head><body><h3>Blocked by <a href="http://p.p/">Privoxy's</a> crude-parental filter due to possible adult content.</h3></body></html> +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{crude-parental} with page containing "sex" +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/crude-parental/pornsite-1/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /crude-parental/pornsite-1/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test201 b/tests/cts/content-filters/data/test201 new file mode 100644 index 00000000..063817fa --- /dev/null +++ b/tests/cts/content-filters/data/test201 @@ -0,0 +1,65 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter crude-parental +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# This is a fairly inoffensive info page which does +# not get blocked by the crude-parental filter: + +Middlesex, Sussex and Essex are counties in the UK. +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# This is a fairly inoffensive info page which does +# not get blocked by the crude-parental filter: + +Middlesex, Sussex and Essex are counties in the UK. +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{crude-parental} with page containing Middlesex, Sussex and Essex +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/crude-parental/harmless-info-page/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /crude-parental/harmless-info-page/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test202 b/tests/cts/content-filters/data/test202 new file mode 100644 index 00000000..28dd503b --- /dev/null +++ b/tests/cts/content-filters/data/test202 @@ -0,0 +1,61 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter crude-parental +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# This is a fake porn side the crude-parental filter should filter: +Come and see wet cunts waiting to get licked!!!! +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 122 + +This page has been blocked by <a href="http://p.p/">Privoxy's</a> crude-parental content filter based on the description. +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{crude-parental} pcrs command 3 with porn description A +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/crude-parental/p0rnpage/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /crude-parental/p0rnpage/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test203 b/tests/cts/content-filters/data/test203 new file mode 100644 index 00000000..f9c12e0b --- /dev/null +++ b/tests/cts/content-filters/data/test203 @@ -0,0 +1,61 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter crude-parental +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# This is a fake porn side the crude-parental filter should filter: +You can rub my balls here!!! +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 122 + +This page has been blocked by <a href="http://p.p/">Privoxy's</a> crude-parental content filter based on the description. +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{crude-parental} pcrs command 3 with porn description B +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/crude-parental/porn-description-b/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /crude-parental/porn-description-b/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test204 b/tests/cts/content-filters/data/test204 new file mode 100644 index 00000000..e93f79ab --- /dev/null +++ b/tests/cts/content-filters/data/test204 @@ -0,0 +1,61 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter crude-parental +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# This is a fake porn side the crude-parental filter should filter: +Suck her dick here!!! +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 122 + +This page has been blocked by <a href="http://p.p/">Privoxy's</a> crude-parental content filter based on the description. +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{crude-parental} pcrs command 3 with porn description C +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/crude-parental/porn-description-c/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /crude-parental/porn-description-c/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test21 b/tests/cts/content-filters/data/test21 new file mode 100644 index 00000000..29bc79ee --- /dev/null +++ b/tests/cts/content-filters/data/test21 @@ -0,0 +1,60 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter crude-parental +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +Here are some Warez. Download them now! +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 120 + +<html><head><title>No Warez</title></head><body><h3>You're not searching for illegal stuff, are you?</h3></body></html> +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{crude-parental} with warez page +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/crude-parental/warez-page-1/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /crude-parental/warez-page-1/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test22 b/tests/cts/content-filters/data/test22 new file mode 100644 index 00000000..34dbf1fe --- /dev/null +++ b/tests/cts/content-filters/data/test22 @@ -0,0 +1,88 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter yahoo +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the yahoo filter should filter: + +# pcrs command 1: + +</head> + +# pcrs command 2: + +<textarea id="composeArea" blafasel width:545px; +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 904 + +# Here are some strings the yahoo filter should filter: + +# pcrs command 1: + + +<style type="text/css"> + /* Style sheet inserted by Privoxy's yahoo filter. */ + #symadbn, #ymadbn, .yschbox, .yschhd, .bbox, #yschsec, #sec, #yschanswr, .yschftad, .yschspn, .yschspns, #ygrp-sponsored-links, #nwad, #MWA2, #MSCM, #yregad, #sponsored-links, #ks-ypn-ads, .ad, #east, #ygrp-vital, .ads {display: none !important;} + #yschpri, #yschweb, #pri, #web, #main, .yschttl, .abstr, .res + {width: 99% !important; max-width: 100% !important;} + .yschttl, .res, .res.indent, #web {padding: 0px; margin: 0px !important;} + #web {padding-left: 0.5em} + #yschqcon, #yschtg {width: auto !important; /* No useless horizontal scrollbar please */} + #composebox #compose_editorArea {width: 70% !important; /* reasonably sized reply textarea please */ + </style> +</head> + + +# pcrs command 2: + +<textarea id="composeArea" blafasel width:70%; +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{yahoo} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/yahoo/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /yahoo/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test23 b/tests/cts/content-filters/data/test23 new file mode 100644 index 00000000..175a64eb --- /dev/null +++ b/tests/cts/content-filters/data/test23 @@ -0,0 +1,124 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter msn +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the msn filter should filter: + +# pcrs command 1: + +</head> + +# pcrs command 2: + +<div id="ads_blafasel"> +<div id='ads_foo'> + +# pcrs command 3: + +<div blafasel class="sb_ads_blafasel"> +<div blafasel class='sb_ads_foo'> + +# pcrs command 4: + +<a href="http://g.msn.com/blafasel\?http://www.example.org/&&DI=tralala" + +# pcrs command 5: + +<a href="http://www.example.org" gping="http://www.example/ping.cgi" +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 1488 + +# Here are some strings the msn filter should filter: + +# pcrs command 1: + +<style type="text/css"> + /* Style sheet inserted by Privoxy's msn filter. */ + .msn_ads, #at, #ar, .mktmsg {display: none !important;} + #results, #b_results, .flank, .results_area_flank, .results_area_stroke, + #results_area, #content, .sb_tlst, .sa_cc, .sb_ph, #sw_main, + .content, .b_content, #sw_foot, #bf, #sw_content, #sidebar, #pag + {width: 99% !important; min-width: 99% !important; + max-width: 100% !important; /* width:100% sometimes causes horizontal scrollbars */} + /* Remove 'related' ads */ + .b_ad, .b_adlabel {clear: both; display:none;} + /* Remove "suggestions". They are next to worthless but partly overlap with the search results */ + .suggestion, #nys_right, #nys {clear: both; display:none;} + /* Remove "Related searches" at the left side of the main results. + They are next to worthless, too, and also are still present below the main search results */ + #b_results > .b_ans {clear: both; display:none;} + #s_notf_div, + /* Overlay ads to enable Facebook 'likes' in search results. */ + .sn_container {display:none !important;} + #content, #b_content {padding: 0px 0px 0px 0px} + </style> +</head> + +# pcrs command 2: + +<div class="msn_ads"> +<div class="msn_ads"> + +# pcrs command 3: + +<div blafasel class="msn_ads"> +<div blafasel class="msn_ads"> + +# pcrs command 4: + +<a href="http://www.example.org/" + +# pcrs command 5: + +<a href="http://www.example.org" title="URL cleaned up by Privoxy's msn filter" +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{msn} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/msn/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /msn/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test24 b/tests/cts/content-filters/data/test24 new file mode 100644 index 00000000..34bcb330 --- /dev/null +++ b/tests/cts/content-filters/data/test24 @@ -0,0 +1,132 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter blogspot +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the blogspot filter should filter: + +# pcrs command 1: + +</head> + +# pcrs command 2: + +<body blafasel> + <div id="space-for-ie"></div> + +# pcrs command 2 does not filter these because it only hits once: + + <div id="content" + <div id="wrap4" + <div id="wrapper" + +# pcrs command 3: + +<div style="blafasel width:30em + +# pcrs command 4: + +background:url("http://www.blogblog.com/roundersblafasel") tralala; + +# pcrs command 5: + +background:#abc url("http://www.blogblog.com/roundersblafasel") tralala;@ + +# pcrs command 6: + +XXX: TODO +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 946 + +# Here are some strings the blogspot filter should filter: + +# pcrs command 1: + +<style type="text/css"> + /* Style sheet inserted by Privoxy's blogspot filter. */ + #powered-by {display: none !important;} + #wrap4, #wrapper {margin-top: 0px } + #blogheader, #header {margin-top: 0.5em !important} + #content {width: 98% } + #main {width: 70% } + #sidebar {width: 29% } + .post-body {overflow: auto;} + .blogComments {width: 100%; overflow: auto;} +</style> +</head> + +# pcrs command 2: + +<body> <!-- Privoxy's blogspot filter ditched some garbage here --> + +# pcrs command 2 does not filter these because it only hits once: + + <div id="content" + <div id="wrap4" + <div id="wrapper" + +# pcrs command 3: + +<div style="blafasel width: 100% + +# pcrs command 4: + +/*background:url("http://www.blogblog.com/roundersblafasel") tralala;*/ + +# pcrs command 5: + +background:#abc ;/* url("http://www.blogblog.com/roundersblafasel") tralala;*/@ + +# pcrs command 6: + +XXX: TODO +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{blogspot} XXX: incomplete test coverage +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/blogspot/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /blogspot/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test25 b/tests/cts/content-filters/data/test25 new file mode 100644 index 00000000..fbd51cfd --- /dev/null +++ b/tests/cts/content-filters/data/test25 @@ -0,0 +1,100 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter sourceforge +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the sourceforge filter should filter: + +# pcrs command 1: + +<div id="banner-sterling" blafasel + +# pcrs command 2: + +<section id="nels" blafasel + +# pcrs command 3: + +<aside class="m-wide-widget m-wide-projects-widget " blafasel + +# pcrs command 4: + +<div id="newsletter-floating" blafasel + +# pcrs command 5: + +<div class="sterling" id="banner-sterling" blafasel +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 488 + +# Here are some strings the sourceforge filter should filter: + +# pcrs command 1: + +<div id="banner-sterling" style="display:none;" blafasel + +# pcrs command 2: + +<section id="nels" style="display:none;" blafasel + +# pcrs command 3: + +<aside class="m-wide-widget m-wide-projects-widget " style="display:none;" blafasel + +# pcrs command 4: + +<div id="newsletter-floating" style="display:none;" blafasel + +# pcrs command 5: + +<div class="sterling" id="banner-sterling" style="display:none;" blafasel +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{sourceforge} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/sourceforge/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /sourceforge/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test3 b/tests/cts/content-filters/data/test3 new file mode 100644 index 00000000..a40485ca --- /dev/null +++ b/tests/cts/content-filters/data/test3 @@ -0,0 +1,121 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter js-annoyances +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the html-annoyances filter should modify: + +# pcrs command 1: + +<a href="http://www.example.org/" resizable="no">click here!</a> +<a href="http://www.example.org/" resizable='0'>click here!</a> + +# pcrs command 2: + +<a href="http://www.example.org/" location="no">click here!</a> +<a href="http://www.example.org/" location='0'>click here!</a> + +# pcrs command 3: + +<a href="http://www.example.org/" status="no">click here!</a> +<a href="http://www.example.org/" status='0'>click here!</a> + +# pcrs command 4: + +<a href="http://www.example.org/" scrolling="no">click here!</a> +<a href="http://www.example.org/" scrolling='0'>click here!</a> + +# pcrs command 5: + +<a href="http://www.example.org/" menubar="no">click here!</a> +<a href="http://www.example.org/" menubar='0'>click here!</a> + +# pcrs command 6: + +<blink>Blink! Blink! Blink!</blink> +<marquee>Annoying marquee text!</marquee> +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 880 + +# Here are some strings the html-annoyances filter should modify: + +# pcrs command 1: + +<a href="http://www.example.org/" resizable="yes">click here!</a> +<a href="http://www.example.org/" resizable='yes'>click here!</a> + +# pcrs command 2: + +<a href="http://www.example.org/" location="yes">click here!</a> +<a href="http://www.example.org/" location='yes'>click here!</a> + +# pcrs command 3: + +<a href="http://www.example.org/" status="yes">click here!</a> +<a href="http://www.example.org/" status='yes'>click here!</a> + +# pcrs command 4: + +<a href="http://www.example.org/" scrolling="auto">click here!</a> +<a href="http://www.example.org/" scrolling='auto'>click here!</a> + +# pcrs command 5: + +<a href="http://www.example.org/" menubar="yes">click here!</a> +<a href="http://www.example.org/" menubar='yes'>click here!</a> + +# pcrs command 6: + +Blink! Blink! Blink! +Annoying marquee text! +</data> +</proxy-reply> + + +<client> +<server> +http +</server> +<name> ++filter{html-annoyances} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/html-annoyances/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /html-annoyances/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test300 b/tests/cts/content-filters/data/test300 new file mode 100644 index 00000000..76ebe2d3 --- /dev/null +++ b/tests/cts/content-filters/data/test300 @@ -0,0 +1,62 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter crude-parental +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# This is a fake "porn" page that triggers pcrs command 4 of the crude-parental filter: + +Download hot asian movies! +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 116 + +This page has been blocked by <a href="http://p.p/">Privoxy's</a> crude-parental content filter based on link text. +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{crude-parental} with "offensive" "link text" A +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/crude-parental/link-text-a/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /crude-parental/link-text-a/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test301 b/tests/cts/content-filters/data/test301 new file mode 100644 index 00000000..04680528 --- /dev/null +++ b/tests/cts/content-filters/data/test301 @@ -0,0 +1,62 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter crude-parental +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# This is a fake "porn" page that triggers pcrs command 4 of the crude-parental filter: + +View cumshot movies now! +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 116 + +This page has been blocked by <a href="http://p.p/">Privoxy's</a> crude-parental content filter based on link text. +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{crude-parental} with "offensive" "link text" B +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/crude-parental/link-text-b/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /crude-parental/link-text-b/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test302 b/tests/cts/content-filters/data/test302 new file mode 100644 index 00000000..913291c4 --- /dev/null +++ b/tests/cts/content-filters/data/test302 @@ -0,0 +1,62 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter crude-parental +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# This is a fake "porn" page that triggers pcrs command 4 of the crude-parental filter: + +Get fucking DVDs of naked ladies here! +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 116 + +This page has been blocked by <a href="http://p.p/">Privoxy's</a> crude-parental content filter based on link text. +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{crude-parental} with "offensive" "link text" C +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/crude-parental/link-text-c/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /crude-parental/link-text-c/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test310 b/tests/cts/content-filters/data/test310 new file mode 100644 index 00000000..fdccb3ad --- /dev/null +++ b/tests/cts/content-filters/data/test310 @@ -0,0 +1,62 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter crude-parental +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# This is a age disclaimer that triggers pcrs command 5 of the crude-parental filter: + +The models are over 16 years old! +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 126 + +This page has been blocked by <a href="http://p.p/">Privoxy's</a> crude-parental content filter because of an age disclaimer. +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{crude-parental} with suspicious age disclaimer A +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/crude-parental/age-disclaimer-a/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /crude-parental/age-disclaimer-a/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test311 b/tests/cts/content-filters/data/test311 new file mode 100644 index 00000000..90fb5074 --- /dev/null +++ b/tests/cts/content-filters/data/test311 @@ -0,0 +1,62 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter crude-parental +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# This is a age disclaimer that triggers pcrs command 5 of the crude-parental filter: + +The chicks are at least 18 years of age or so we claim! +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 126 + +This page has been blocked by <a href="http://p.p/">Privoxy's</a> crude-parental content filter because of an age disclaimer. +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{crude-parental} with suspicious age disclaimer B +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/crude-parental/age-disclaimer-b/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /crude-parental/age-disclaimer-b/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test312 b/tests/cts/content-filters/data/test312 new file mode 100644 index 00000000..e6fdd5ab --- /dev/null +++ b/tests/cts/content-filters/data/test312 @@ -0,0 +1,62 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter crude-parental +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# This is a age disclaimer that triggers pcrs command 5 of the crude-parental filter: + +The persons were over 21 years old last we checked! +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 126 + +This page has been blocked by <a href="http://p.p/">Privoxy's</a> crude-parental content filter because of an age disclaimer. +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{crude-parental} with suspicious age disclaimer C +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/crude-parental/age-disclaimer-c/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /crude-parental/age-disclaimer-c/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test320 b/tests/cts/content-filters/data/test320 new file mode 100644 index 00000000..5a2a9add --- /dev/null +++ b/tests/cts/content-filters/data/test320 @@ -0,0 +1,62 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter crude-parental +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# This regulation text triggers pcrs command 6 of the crude-parental filter: + +We comply with section 2257 of whatever! +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 128 + +This page has been blocked by <a href="http://p.p/">Privoxy's</a> crude-parental content filter because of an regulations text. +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{crude-parental} with suspicious regulation text A +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/crude-parental/regulation-text-a/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /crude-parental/regulation-text-a/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test321 b/tests/cts/content-filters/data/test321 new file mode 100644 index 00000000..7fe80898 --- /dev/null +++ b/tests/cts/content-filters/data/test321 @@ -0,0 +1,62 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter crude-parental +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# This regulation text triggers pcrs command 6 of the crude-parental filter: + +We comply with code 18 U.S.C. 2257 of whatever! +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 128 + +This page has been blocked by <a href="http://p.p/">Privoxy's</a> crude-parental content filter because of an regulations text. +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{crude-parental} with suspicious regulation text B +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/crude-parental/regulation-text-b/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /crude-parental/regulation-text-b/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test322 b/tests/cts/content-filters/data/test322 new file mode 100644 index 00000000..330e9c13 --- /dev/null +++ b/tests/cts/content-filters/data/test322 @@ -0,0 +1,62 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter crude-parental +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# This regulation text triggers pcrs command 6 of the crude-parental filter: + +We comply with code 18 USC 2257 of whatever! +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 128 + +This page has been blocked by <a href="http://p.p/">Privoxy's</a> crude-parental content filter because of an regulations text. +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{crude-parental} with suspicious regulation text C +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/crude-parental/regulation-text-c/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /crude-parental/regulation-text-c/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test33 b/tests/cts/content-filters/data/test33 new file mode 100644 index 00000000..f1dc0db4 --- /dev/null +++ b/tests/cts/content-filters/data/test33 @@ -0,0 +1,99 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter ie-exploits +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the ie-exploits filter should filter: + +# pcrs command 1: + +f("javascript:location.replace('mk:@MSITStore:C:')"); + +# pcrs command 2: + +<a href="http://www.example.org/%hex[%01]hex%@blafasel"> +<a href="http://www.example.org/%hex[%02]hex%@blafasel"> +<a href="http://www.example.org/%hex[%03]hex%@blafasel"> + +<a href="http://www.example.org/%00@blafasel"> +<a href="http://www.example.org/%01@blafasel"> +<a href="http://www.example.org/%02@blafasel"> + +# pcrs command 3: + +<script language="JavaScript">window.open("readme.eml", null, "resizable=no,top=6000,left=6000")</script> +<script language="JavaScript">1;''.concat("readme.eml", null, "resizable=no,top=6000,left=6000")</script> +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 890 + +# Here are some strings the ie-exploits filter should filter: + +# pcrs command 1: + +alert("This page looks like it tries to use a vulnerability described here: + http://online.securityfocus.com/archive/1/298748/2002-11-02/2002-11-08/2"); + +# pcrs command 2: + +<a href="http://www.example.org/MALICIOUS-LINK@blafasel"> +<a href="http://www.example.org/MALICIOUS-LINK@blafasel"> +<a href="http://www.example.org/MALICIOUS-LINK@blafasel"> + +<a href="http://www.example.org/MALICIOUS-LINK@blafasel"> +<a href="http://www.example.org/MALICIOUS-LINK@blafasel"> +<a href="http://www.example.org/MALICIOUS-LINK@blafasel"> + +# pcrs command 3: + +<br><font size="7"> WARNING: This Server is infected with <a href="http://www.cert.org/advisories/CA-2001-26.html">Nimda</a>!</font> +<br><font size="7"> WARNING: This Server is infected with <a href="http://www.cert.org/advisories/CA-2001-26.html">Nimda</a>!</font> +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{ie-exploits} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/ie-exploits/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /ie-exploits/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test34 b/tests/cts/content-filters/data/test34 new file mode 100644 index 00000000..03226986 --- /dev/null +++ b/tests/cts/content-filters/data/test34 @@ -0,0 +1,134 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter site-specifics +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the site-specifics filter should filter: + +# pcrs command 1: + +indexOf("x11") + +# pcrs command 2 (XXX: should probably kill the parens as well): + +mylogfunc() + +# pcrs command 3: + +<a href="http://www.example.org/">Continue to message</a> +<a href="http://www.example.org/">Weiter zu Nachricht</a> + +# pcrs command 4: + +<input type="hidden" name="REDIRECT" value="http://www.example.org/"> + +# pcrs command 5: + +<IMG SRC="http://media.monster.com/mm/usen/my/no_thanks_211x40.gif" blafasel> + +# pcrs command 6: + +<img blafasel onload="alert('blafasel')" + +# pcrs command 7: + +<INPUT name="1234" type="RADIO" value="0" CHECKED +<INPUT name="123" type="RADIO" value="0" CHECKED +<INPUT name="12" type="RADIO" value="0" CHECKED + +# pcrs command 8: + +<INPUT name="12" type="RADIO" value="3" +<INPUT name="123" type="RADIO" value="3" +<INPUT name="1233" type="RADIO" value="3" +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 888 + +# Here are some strings the site-specifics filter should filter: + +# pcrs command 1: + +indexOf("x13") + +# pcrs command 2 (XXX: should probably kill the parens as well): + +() + +# pcrs command 3: + +<meta http-equiv="refresh" content="0; URL=http://www.example.org/"> +<meta http-equiv="refresh" content="0; URL=http://www.example.org/"> + +# pcrs command 4: + +<meta http-equiv="refresh" content="0; URL=http://www.example.org/"> + +# pcrs command 5: + +<meta http-equiv="refresh" content="0; URL=http://my.monster.com/resume.asp"> + +# pcrs command 6: + +<img blafasel never="alert('blafasel')" + +# pcrs command 7: + +<INPUT name="1234" type="RADIO" value="0" +<INPUT name="123" type="RADIO" value="0" +<INPUT name="12" type="RADIO" value="0" + +# pcrs command 8: + +<INPUT name="12" type="RADIO" value="3" checked +<INPUT name="123" type="RADIO" value="3" checked +<INPUT name="1233" type="RADIO" value="3" checked +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{site-specifics} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/site-specifics/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /site-specifics/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test35 b/tests/cts/content-filters/data/test35 new file mode 100644 index 00000000..e5c83269 --- /dev/null +++ b/tests/cts/content-filters/data/test35 @@ -0,0 +1,80 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter no-ping +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the no-ping filter should filter: + +<a ping="http://www.example.org/ping-target" href="http://www.example.org/link-target">click here</a> + +<a ping='http://www.example.org/ping-target' href="http://www.example.org/link-target">click here</a> + +<area ping="http://www.example.org/ping-target" href="http://www.example.org/link-target"> + +<area ping='http://www.example.org/ping-target' href="http://www.example.org/link-target"> +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 836 + +# Here are some strings the no-ping filter should filter: + +<strong style="color:white; background-color:red;" title="Privoxy removed ping target 'http://www.example.org/ping-target'">PING!</strong> +<a href="http://www.example.org/link-target">click here</a> + +<strong style="color:white; background-color:red;" title="Privoxy removed ping target 'http://www.example.org/ping-target'">PING!</strong> +<a href="http://www.example.org/link-target">click here</a> + +<strong style="color:white; background-color:red;" title="Privoxy removed ping target 'http://www.example.org/ping-target'">PING!</strong> +<area href="http://www.example.org/link-target"> + +<strong style="color:white; background-color:red;" title="Privoxy removed ping target 'http://www.example.org/ping-target'">PING!</strong> +<area href="http://www.example.org/link-target"> +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{no-ping} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/no-ping/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /no-ping/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test36 b/tests/cts/content-filters/data/test36 new file mode 100644 index 00000000..e1217096 --- /dev/null +++ b/tests/cts/content-filters/data/test36 @@ -0,0 +1,84 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter allow-autocompletion +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the allow-autocompletion filter should filter: + +<input blafasel autocomplete="off" +<input blafasel autocomplete='0' + +<form blafasel autocomplete="off" +<form blafasel autocomplete='0' + +<select blafasel autocomplete="off" +<select blafasel autocomplete='0' + +<textarea blafasel autocomplete="off" +<textarea blafasel autocomplete='0' +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 353 + +# Here are some strings the allow-autocompletion filter should filter: + +<input blafasel autocomplete="on" +<input blafasel autocomplete='on' + +<form blafasel autocomplete="on" +<form blafasel autocomplete='on' + +<select blafasel autocomplete="on" +<select blafasel autocomplete='on' + +<textarea blafasel autocomplete="on" +<textarea blafasel autocomplete='on' +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{allow-autocompletion} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/allow-autocompletion/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /allow-autocompletion/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test37 b/tests/cts/content-filters/data/test37 new file mode 100644 index 00000000..39c1555b --- /dev/null +++ b/tests/cts/content-filters/data/test37 @@ -0,0 +1,74 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter github +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the github filter should filter: + +<signup-prompt blafasel> +Come join our proprietary platform!!! +</signup-prompt> + +<div class="hx_cookie-banner> +By the way, we are using cookies to track you. +</div> +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 166 + +# Here are some strings the github filter should filter: + + + +<div style="display:none;" class="hx_cookie-banner> +By the way, we are using cookies to track you. +</div> +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{github} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/github/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /github/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test38 b/tests/cts/content-filters/data/test38 new file mode 100644 index 00000000..9b9f6b49 --- /dev/null +++ b/tests/cts/content-filters/data/test38 @@ -0,0 +1,84 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter imdb +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the imdb filter should filter: + +# pcrs command 1: + +<div id="top_ad_wrapper" + +# pcrs command 2: + +<iframe blafasel id="top_ad" tralala></iframe> + +# pcrs command 3: + +<iframe blafasel onload="doWithAds.call bumfidel></iframe> +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 259 + +# Here are some strings the imdb filter should filter: + +# pcrs command 1: + +<div id="top_ad_wrapper" style="display:none" + +# pcrs command 2: + +<!-- Iframe removed by Privoxy's imdb filter --> + +# pcrs command 3: + +<!-- Iframe removed by Privoxy's imdb filter --> +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{imdb} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/imdb/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /imdb/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test390 b/tests/cts/content-filters/data/test390 new file mode 100644 index 00000000..dc771467 --- /dev/null +++ b/tests/cts/content-filters/data/test390 @@ -0,0 +1,115 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter google +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the google filter should filter: + +# pcrs command 1: + +</head> + +# pcrs command 2: + +<div style="padding-top:11px;min-width:500px"> + +# pcrs command 3: + +<table cellspacing=0 cellpadding=0 width=25% align=right bgcolor=#ffffff border=0 + +# pcrs command 3 does not filter these because it only hits one pattern: + +</font></td></tr></tbody></table><table align="right" bgcolor="#ffffff" + +<table cellspacing=0 cellpadding=0 align=right bgcolor=#ffffff border=0 + +<table style="clear:both" align=right width=25% cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" + +# pcrs command 4: + +<br clear=all><table border=0 cellpadding=9><tr><td +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 1023 + +# Here are some strings the google filter should filter: + +# pcrs command 1: + +<style type="text/css"> + /* Style sheet inserted by Privoxy's google filter. */ + #fbc, #fbl, #ra, .rhh {visibility: hidden !important;} + #tpa1,#tpa2,#tpa3,#tpa4,#tpa5,#tpa5, #spl, .ch, #ads, #toolbar, #google_ads_frame, #mbEnd {display: none !important;} + .main_body, .j, #res, .med, .hd, .g, .s + {width: 99%; max-width: 100%; margin-left: 0; margin-right: 0;} + </style> +</head> + +# pcrs command 2: + +<div id="main_body"> + +# pcrs command 3: + +<table cellspacing=0 cellpadding=0 width=25% align=right bgcolor=#ffffff border=0 id="ads" + +# pcrs command 3 does not filter these because it only hits one pattern: + +</font></td></tr></tbody></table><table align="right" bgcolor="#ffffff" + +<table cellspacing=0 cellpadding=0 align=right bgcolor=#ffffff border=0 + +<table style="clear:both" align=right width=25% cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" + +# pcrs command 4: + +<br clear=all><table id="toolbar" border=0 cellpadding=9><tr><td +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{google} - multiple pcrs commands triggered +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/google/multiple-pcrs-commands/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /google/multiple-pcrs-commands/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test391 b/tests/cts/content-filters/data/test391 new file mode 100644 index 00000000..fa41d0a9 --- /dev/null +++ b/tests/cts/content-filters/data/test391 @@ -0,0 +1,63 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter google +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here is a string the google filter's pcrs command 3 should filter: + +</font></td></tr></tbody></table><table align="right" bgcolor="#ffffff" +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Content-Type: text/html +X-Control: swsclose +Content-Length: 151 + +# Here is a string the google filter's pcrs command 3 should filter: + +</font></td></tr></tbody></table><table align="right" bgcolor="#ffffff" id="ads" +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{google} - pcrs command 3 - pattern B +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/google/pcrs-command-3b/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /google/pcrs-command-3b/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test392 b/tests/cts/content-filters/data/test392 new file mode 100644 index 00000000..c93f99b5 --- /dev/null +++ b/tests/cts/content-filters/data/test392 @@ -0,0 +1,64 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter google +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here is a string the google filter's pcrs command 3 should filter: + +<table cellspacing=0 cellpadding=0 align=right bgcolor=#ffffff border=0 +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 151 + +# Here is a string the google filter's pcrs command 3 should filter: + +<table cellspacing=0 cellpadding=0 align=right bgcolor=#ffffff border=0 id="ads" +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{google} - pcrs command 3 - pattern C +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/google/pcrs-command-3c/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /google/pcrs-command-3c/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test393 b/tests/cts/content-filters/data/test393 new file mode 100644 index 00000000..2f19c093 --- /dev/null +++ b/tests/cts/content-filters/data/test393 @@ -0,0 +1,63 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter google +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here is a string the google filter's pcrs command 3 should filter: + +<table style="clear:both" align=right width=25% cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Content-Type: text/html +X-Control: swsclose +Content-Length: 188 + +# Here is a string the google filter's pcrs command 3 should filter: + +<table style="clear:both" align=right width=25% cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" id="ads" +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{google} - pcrs command 3 - pattern D +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/google/pcrs-command-3d/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /google/pcrs-command-3d/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test4 b/tests/cts/content-filters/data/test4 new file mode 100644 index 00000000..f1eb3e32 --- /dev/null +++ b/tests/cts/content-filters/data/test4 @@ -0,0 +1,81 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter content-cookies +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the content-cookies filter should modify: + +# pcrs command 1: + +blafasel.cookie=tralala=12 +blafasel.cookie='aab=keep-me-unmodified' + +# pcrs command 2: + +<meta http-equiv="set-cookie" content="blafasel=123"> +<meta http-equiv='set-cookie' content="blafasel=123"> +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 215 + +# Here are some strings the content-cookies filter should modify: + +# pcrs command 1: + +ZappedCookie=tralala=12 +blafasel.cookie='aab=keep-me-unmodified' + +# pcrs command 2: + +<!-- ZappedCookie --> +<!-- ZappedCookie --> +</data> +</proxy-reply> + + +<client> +<server> +http +</server> +<name> ++filter{content-cookies} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/content-cookies/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /content-cookies/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test5 b/tests/cts/content-filters/data/test5 new file mode 100644 index 00000000..c345b84a --- /dev/null +++ b/tests/cts/content-filters/data/test5 @@ -0,0 +1,89 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter refresh-tags +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the refresh-tags filter should modify: + +<meta http-equiv="refresh" content="15; url=https://www.privoxy.org/"> +<meta http-equiv='refresh' content='20; url=https://www.privoxy.org/'> + +# Here are some strings the refresh-tags filter should not modify: + +<meta http-equiv="refresh" content="1; url=https://www.privoxy.org/"> +<meta http-equiv='refresh' content='2; url=https://www.privoxy.org/'> +<meta http-equiv='refresh' content='3; url=https://www.privoxy.org/'> +<meta http-equiv='refresh' content='4; url=https://www.privoxy.org/'> +<meta http-equiv='refresh' content='5; url=https://www.privoxy.org/'> +<meta http-equiv='refresh' content='6; url=https://www.privoxy.org/'> +<meta http-equiv='refresh' content='7; url=https://www.privoxy.org/'> +<meta http-equiv='refresh' content='8; url=https://www.privoxy.org/'> +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 803 + +# Here are some strings the refresh-tags filter should modify: + +<link rev="x-refresh" href="https://www.privoxy.org/"> +<link rev="x-refresh" href="https://www.privoxy.org/"> + +# Here are some strings the refresh-tags filter should not modify: + +<meta http-equiv="refresh" content="1; url=https://www.privoxy.org/"> +<meta http-equiv='refresh' content='2; url=https://www.privoxy.org/'> +<meta http-equiv='refresh' content='3; url=https://www.privoxy.org/'> +<meta http-equiv='refresh' content='4; url=https://www.privoxy.org/'> +<meta http-equiv='refresh' content='5; url=https://www.privoxy.org/'> +<meta http-equiv='refresh' content='6; url=https://www.privoxy.org/'> +<meta http-equiv='refresh' content='7; url=https://www.privoxy.org/'> +<meta http-equiv='refresh' content='8; url=https://www.privoxy.org/'> +</data> +</proxy-reply> + + +<client> +<server> +http +</server> +<name> ++filter{refresh-tags} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/refresh-tags/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /refresh-tags/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test6 b/tests/cts/content-filters/data/test6 new file mode 100644 index 00000000..f4d88f43 --- /dev/null +++ b/tests/cts/content-filters/data/test6 @@ -0,0 +1,97 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter unsolicited-popups +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the unsolicited-popups filter should modify: + +# pcrs command 1: + +<head blafasel> + +# pcrs command 2: + +blafasel + window.open( +blafasel - mapwindow.open( +blafasel + mapthis.open( +blafasel - mapparent.open( +blafasel + window.open( +blafasel = this.open( +blafasel = parent.open( + +# pcrs command 3: + +aslkdfalksjfd </html> +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 520 + +# Here are some strings the unsolicited-popups filter should modify: + +# pcrs command 1: + +<head blafasel><script>function PrivoxyWindowOpen(){return(null);}</script> + +# pcrs command 2: + +blafasel + PrivoxyWindowOpen( +blafasel - PrivoxyWindowOpen( +blafasel + PrivoxyWindowOpen( +blafasel - PrivoxyWindowOpen( +blafasel + PrivoxyWindowOpen( +blafasel = PrivoxyWindowOpen( +blafasel = PrivoxyWindowOpen( + +# pcrs command 3: + +aslkdfalksjfd </html><script>function PrivoxyWindowOpen(a, b, c){return(window.open(a, b, c));}</script> +</data> +</proxy-reply> + + +<client> +<server> +http +</server> +<name> ++filter{unsolicited-popups} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/unsolicited-popups/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /unsolicited-popups/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test7 b/tests/cts/content-filters/data/test7 new file mode 100644 index 00000000..6393fab8 --- /dev/null +++ b/tests/cts/content-filters/data/test7 @@ -0,0 +1,89 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter all-popups +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the all-popups filter should modify: + +# pcrs command 1: + ++ mapwindow.open( ++ window.open( ++ this.open( ++ parent.open( + +# pcrs command 2: + + target = "blank" + target = 'blank' + target = "new" + target = 'new' +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 178 + +# Here are some strings the all-popups filter should modify: + +# pcrs command 1: + ++ mapwindow.concat( ++ window.concat( ++ this.concat( ++ parent.concat( + +# pcrs command 2: + + + + + +</data> +</proxy-reply> + + +<client> +<server> +http +</server> +<name> ++filter{all-popups} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/all-popups/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /all-popups/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test8 b/tests/cts/content-filters/data/test8 new file mode 100644 index 00000000..75f49ae4 --- /dev/null +++ b/tests/cts/content-filters/data/test8 @@ -0,0 +1,105 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter img-reorder +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here are some strings the img-reorder filter should modify: + +<img alt="blafasel" src="http://example.org/"> +<img alt="blafasel" title="blafasel" src="http://example.org/"> +<img alt='blafasel' title='blafasel' src="http://example.org/"> +<img width="100" height="100" src="http://example.org/"> +<img width=100 height=100 src="http://example.org/"> +<img width=100 height='100' src="http://example.org/"> +<img width="100" height=100 src="http://example.org/"> +<img width="100" height=100 src="http://example.org/"> +<img width=100 src="http://example.org/" height='100'> +<img src="http://example.org/" width="100" height=100> +<img width="100" height=100 src="http://example.org/"> + +<img src="http://example.org/" alt="blafasel"> + +<img data-index="0" class="lazy" src="" data-original="blafasel.jpg" title=""> +<img data-index="0" class="lazy" src='' data-original='blafasel.jpg' title=""> + +<img data-index="0" class="lazy" src="a" data-original="blafasel.jpg" title=""> +<img data-index="0" class="lazy" src='b' data-original='blafasel.jpg' title=""> + +<img width=888 height=573 src=socket.png> +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 1089 + +# Here are some strings the img-reorder filter should modify: + +<img src="http://example.org/" alt="blafasel"> +<img src="http://example.org/" alt="blafasel" title="blafasel"> +<img src="http://example.org/" alt='blafasel' title='blafasel'> +<img src="http://example.org/" width="100" height="100"> +<img src="http://example.org/" width=100 height=100> +<img src="http://example.org/" width=100 height='100'> +<img src="http://example.org/" width="100" height=100> +<img src="http://example.org/" width="100" height=100> +<img src="http://example.org/" width=100 height='100'> +<img src="http://example.org/" width="100" height=100> +<img src="http://example.org/" width="100" height=100> + +<img src="http://example.org/" alt="blafasel"> + +<img data-index="0" class="lazy" src="" data-original="blafasel.jpg" title=""> +<img data-index="0" class="lazy" src='' data-original='blafasel.jpg' title=""> + +<img src="a" data-index="0" class="lazy" data-original="blafasel.jpg" title=""> +<img src='b' data-index="0" class="lazy" data-original='blafasel.jpg' title=""> + +<img src=socket.png width=888 height=573> +</data> +</proxy-reply> + + +<client> +<server> +http +</server> +<name> ++filter{img-reorder} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/img-reorder/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /img-reorder/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/data/test9 b/tests/cts/content-filters/data/test9 new file mode 100644 index 00000000..7695fac0 --- /dev/null +++ b/tests/cts/content-filters/data/test9 @@ -0,0 +1,236 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +filter banners-by-size +</keywords> +</info> + +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +# Here is some HTML that the banners-by-size filter should modify: + +# pcrs command 1 (88*31): + +<img src="http://www.privoxy.org/images/privoxy.png" width="88" height="31"> +<img src="https://www.privoxy.org/images/privoxy.png" width="88" height="31"> +<img src='http://www.privoxy.org/images/privoxy.png' width='88' height='31'> +<img src="http://www.privoxy.org/images/privoxy.png" width="88" height="31"> + +# pcrs command 2 (120*60, 120*90, 120*240, 120*600): + +<img src="http://www.privoxy.org/images/privoxy.png" width="120" height="60"> +<img src="https://www.privoxy.org/images/privoxy.png" width="120" height="60"> +<img src='http://www.privoxy.org/images/privoxy.png' width='120' height='60'> +<img src="http://www.privoxy.org/images/privoxy.png" width="120" height="60"> + +<img src="http://www.privoxy.org/images/privoxy.png" width="120" height="90"> +<img src="https://www.privoxy.org/images/privoxy.png" width="120" height="90"> +<img src='http://www.privoxy.org/images/privoxy.png' width='120' height='90'> +<img src="http://www.privoxy.org/images/privoxy.png" width="120" height="90"> + +<img src="http://www.privoxy.org/images/privoxy.png" width="120" height="240"> +<img src="https://www.privoxy.org/images/privoxy.png" width="120" height="240"> +<img src='http://www.privoxy.org/images/privoxy.png' width='120' height='240'> +<img src="http://www.privoxy.org/images/privoxy.png" width="120" height="240"> + +<img src="http://www.privoxy.org/images/privoxy.png" width="120" height="600"> +<img src="https://www.privoxy.org/images/privoxy.png" width="120" height="600"> +<img src='http://www.privoxy.org/images/privoxy.png' width='120' height='600'> +<img src="http://www.privoxy.org/images/privoxy.png" width="120" height="600"> + +# pcrs command 3 (125*125): + +<img src="http://www.privoxy.org/images/privoxy.png" width="125" height="125"> +<img src="https://www.privoxy.org/images/privoxy.png" width="125" height="125"> +<img src='http://www.privoxy.org/images/privoxy.png' width='125' height='125'> +<img src="http://www.privoxy.org/images/privoxy.png" width="125" height="125"> + +# pcrs command 4 (160*600): + +<img src="http://www.privoxy.org/images/privoxy.png" width="160" height="600"> +<img src="https://www.privoxy.org/images/privoxy.png" width="160" height="600"> +<img src='http://www.privoxy.org/images/privoxy.png' width='160' height='600'> +<img src="http://www.privoxy.org/images/privoxy.png" width="160" height="600"> + +# pcrs command 5 (180*150): + +<img src="http://www.privoxy.org/images/privoxy.png" width="180" height="150"> +<img src="https://www.privoxy.org/images/privoxy.png" width="180" height="150"> +<img src='http://www.privoxy.org/images/privoxy.png' width='180' height='150'> +<img src="http://www.privoxy.org/images/privoxy.png" width="180" height="150"> + +# pcrs command 6 (234*60, 468*60): + +<img src="http://www.privoxy.org/images/privoxy.png" width="234" height="60"> +<img src="https://www.privoxy.org/images/privoxy.png" width="234" height="60"> +<img src='http://www.privoxy.org/images/privoxy.png' width='234' height='60'> +<img src="http://www.privoxy.org/images/privoxy.png" width="234" height="60"> + +<img src="http://www.privoxy.org/images/privoxy.png" width="468" height="60"> +<img src="https://www.privoxy.org/images/privoxy.png" width="468" height="60"> +<img src='http://www.privoxy.org/images/privoxy.png' width='468' height='60'> +<img src="http://www.privoxy.org/images/privoxy.png" width="468" height="60"> + +# pcrs command 7 (240*400): + +<img src="http://www.privoxy.org/images/privoxy.png" width="240" height="400"> +<img src="https://www.privoxy.org/images/privoxy.png" width="240" height="400"> +<img src='http://www.privoxy.org/images/privoxy.png' width='240' height='400'> +<img src="http://www.privoxy.org/images/privoxy.png" width="240" height="400"> + +# pcrs command 8 (250*250, 300*250): + +<img src="http://www.privoxy.org/images/privoxy.png" width="250" height="250"> +<img src="https://www.privoxy.org/images/privoxy.png" width="250" height="250"> +<img src='http://www.privoxy.org/images/privoxy.png' width='250' height='250'> +<img src="http://www.privoxy.org/images/privoxy.png" width="250" height="250"> + +<img src="http://www.privoxy.org/images/privoxy.png" width="300" height="250"> +<img src="https://www.privoxy.org/images/privoxy.png" width="300" height="250"> +<img src='http://www.privoxy.org/images/privoxy.png' width='300' height='250'> +<img src="http://www.privoxy.org/images/privoxy.png" width="300" height="250"> + +# pcrs command 8 (336*280): + +<img src="http://www.privoxy.org/images/privoxy.png" width="336" height="280"> +<img src="https://www.privoxy.org/images/privoxy.png" width="336" height="280"> +<img src='http://www.privoxy.org/images/privoxy.png' width='336' height='280'> +<img src="http://www.privoxy.org/images/privoxy.png" width="336" height="280"> +</data> +</reply> + +<proxy-reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 9499 + +# Here is some HTML that the banners-by-size filter should modify: + +# pcrs command 1 (88*31): + + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="88" height="31"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-https://www.privoxy.org/images/privoxy.png-by-size" width="88" height="31"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width='88' height='31'> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="88" height="31"> + +# pcrs command 2 (120*60, 120*90, 120*240, 120*600): + + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="120" height="60"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-https://www.privoxy.org/images/privoxy.png-by-size" width="120" height="60"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width='120' height='60'> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="120" height="60"> + + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="120" height="90"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-https://www.privoxy.org/images/privoxy.png-by-size" width="120" height="90"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width='120' height='90'> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="120" height="90"> + + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="120" height="240"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-https://www.privoxy.org/images/privoxy.png-by-size" width="120" height="240"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width='120' height='240'> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="120" height="240"> + + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="120" height="600"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-https://www.privoxy.org/images/privoxy.png-by-size" width="120" height="600"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width='120' height='600'> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="120" height="600"> + +# pcrs command 3 (125*125): + + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="125" height="125"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-https://www.privoxy.org/images/privoxy.png-by-size" width="125" height="125"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width='125' height='125'> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="125" height="125"> + +# pcrs command 4 (160*600): + + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="160" height="600"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-https://www.privoxy.org/images/privoxy.png-by-size" width="160" height="600"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width='160' height='600'> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="160" height="600"> + +# pcrs command 5 (180*150): + + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="180" height="150"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-https://www.privoxy.org/images/privoxy.png-by-size" width="180" height="150"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width='180' height='150'> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="180" height="150"> + +# pcrs command 6 (234*60, 468*60): + + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="234" height="60"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-https://www.privoxy.org/images/privoxy.png-by-size" width="234" height="60"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width='234' height='60'> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="234" height="60"> + + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="468" height="60"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-https://www.privoxy.org/images/privoxy.png-by-size" width="468" height="60"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width='468' height='60'> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="468" height="60"> + +# pcrs command 7 (240*400): + + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="240" height="400"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-https://www.privoxy.org/images/privoxy.png-by-size" width="240" height="400"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width='240' height='400'> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="240" height="400"> + +# pcrs command 8 (250*250, 300*250): + + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="250" height="250"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-https://www.privoxy.org/images/privoxy.png-by-size" width="250" height="250"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width='250' height='250'> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="250" height="250"> + + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="300" height="250"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-https://www.privoxy.org/images/privoxy.png-by-size" width="300" height="250"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width='300' height='250'> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="300" height="250"> + +# pcrs command 8 (336*280): + + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="336" height="280"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-https://www.privoxy.org/images/privoxy.png-by-size" width="336" height="280"> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width='336' height='280'> + <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="336" height="280"> +</data> +</proxy-reply> + +<client> +<server> +http +</server> +<name> ++filter{banners-by-size} +</name> +<features> +proxy +</features> +<command> +http://%HOSTIP:%HTTPPORT/banners-by-size/%TESTNUMBER +</command> +</client> + +<verify> +<protocol> +GET /banners-by-size/%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* +Connection: close + +</protocol> +</verify> +</testcase> diff --git a/tests/cts/content-filters/privoxy.conf b/tests/cts/content-filters/privoxy.conf new file mode 100644 index 00000000..2b673000 --- /dev/null +++ b/tests/cts/content-filters/privoxy.conf @@ -0,0 +1,17 @@ +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 + +filterfile ../../../default.filter +actionsfile ./content-filters.action