1 #############################################################################
3 # This is a configuration file for Privoxy-Regression-Test
4 # (included in the source tarball's tools directory).
6 # After referencing it in your Privoxy configuration both Privoxy and
7 # Privoxy-Regression-Test should be good to go.
9 #############################################################################
11 # Copyright (c) 2007-2020 Fabian Keil <fk@fabiankeil.de>
13 # Permission to use, copy, modify, and distribute this software for any
14 # purpose with or without fee is hereby granted, provided that the above
15 # copyright notice and this permission notice appear in all copies.
17 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
18 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
19 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
20 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
21 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
22 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
23 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25 #############################################################################
28 for-privoxy-version=3.0.29
30 # Some dependencies Privoxy-Regression-Test should know about:
32 # Level 9 needs = config line user-manual\s+(\.?\.?/|[A-Za-z]:)
33 # Level 12 needs = feature status FEATURE_CGI_EDIT_ACTIONS Yes
34 # Level 12 needs = config line enable-edit-actions\s+1
35 # Level 13 needs = feature status FEATURE_CONNECTION_KEEP_ALIVE Yes
36 # Level 13 needs = config line keep-alive-timeout\s+(2[1-9]+|[3-9]\d+|1\d{2,})
37 # Level 14 needs = feature status FEATURE_CONNECTION_KEEP_ALIVE No
38 # Level 15 needs = config line connection-sharing\s+0
39 # Level 16 needs = feature status FEATURE_CONNECTION_KEEP_ALIVE Yes
40 # Level 16 needs = config line connection-sharing\s+1
41 # Level 17 needs = feature status FEATURE_64_BIT_TIME_T Yes
42 # Level 18 needs = feature status FEATURE_GRACEFUL_TERMINATION No
43 # Level 19 needs = feature status FEATURE_GRACEFUL_TERMINATION Yes
44 # Level 20 needs = config line enable-remote-toggle\s+1
45 # Level 21 needs = config line enable-remote-toggle\s+0
46 # Level 22 needs = config line enable-proxy-authentication-forwarding\s+0
47 # Level 23 needs = config line enable-proxy-authentication-forwarding\s+1
48 # Level 24 needs = feature status FEATURE_CLIENT_TAGS Yes
49 # Level 25 needs = feature status FEATURE_HTTPS_INSPECTION No
50 # Level 26 needs = feature status FEATURE_PCRE_HOST_PATTERNS Yes
52 #######################################################
53 # Enable taggers to activate the tests on demand
54 # and suppress hiding the User-Agent for
55 # Privoxy-Regression-Test to save log space.
56 #######################################################
58 +client-header-tagger{user-agent} \
59 +client-header-tagger{privoxy-control} \
60 +client-header-filter{privoxy-control} \
67 TAG:^User-Agent: Privoxy-Regression-Test
69 #######################################################
70 # Test accept-language{}.
71 #######################################################
73 {+hide-accept-language{en-gb}}
74 # Set Header = Accept-Language: de-de
75 # Expect Header = Accept-Language: en-gb
76 TAG:^hide-accept-language\{en-gb\}$
78 {+hide-accept-language{block}}
79 # Set Header = Accept-Language: de-de
80 # Expect Header = REMOVAL
81 TAG:^hide-accept-language\{block\}$
83 #######################################################
84 # Sections for hide-referrer{} to test:
86 # 1) conditional-block
87 # 2) conditional-forge
90 # 5) a parameter that looks like a valid fake referrer
91 # 6) a parameter that looks like an invalid fake referrer
92 #######################################################
94 {+hide-referrer{conditional-block}}
95 # Set Header = Referer: http://www.example.org/foo
96 # Expect Header = REMOVAL
98 # Set Header = Referer: http://p.p/foo
99 # Expect Header = NO CHANGE
101 # Set Header = Referer: p.p/
102 # Expect Header = REMOVAL
104 # Set Header = Referer: p
105 # Expect Header = REMOVAL
107 # Set Header = Referer: http://
108 # Expect Header = REMOVAL
110 # Set Header = Referer: https://p.p/
111 # Expect Header = REMOVAL
112 TAG:^hide-referrer\{conditional-block\}$
114 {+hide-referrer{conditional-forge}}
115 # Set Header = Referer: http://www.example.org/foo
116 # Expect Header = Referer: http://p.p/
118 # Set Header = Referer: http://p.p/foo
119 # Expect Header = NO CHANGE
121 # Set Header = Referer: p.p/
122 # Expect Header = Referer: http://p.p/
124 # Set Header = Referer: p
125 # Expect Header = Referer: http://p.p/
127 # Set Header = Referer: http://
128 # Expect Header = Referer: http://p.p/
130 # Set Header = Referer: https://p.p/
131 # Expect Header = Referer: http://p.p/
132 TAG:^hide-referrer\{conditional-forge\}$
134 {+hide-referrer{forge}}
135 # Set Header = Referer: http://www.example.org/foo
136 # Expect Header = Referer: http://p.p/
137 TAG:^hide-referrer\{forge\}$
139 {+hide-referrer{block}}
140 # Set Header = Referer: http://www.example.org/foo
141 # Expect Header = REMOVAL
142 TAG:^hide-referrer\{block\}$
144 {+hide-referrer{invalid}}
145 # Set Header = Referer: http://www.example.org/foo
146 # Expect Header = Referer: invalid
147 TAG:^hide-referrer\{invalid\}$
149 {+hide-referrer{http://www.privoxy.org/}}
150 # Set Header = Referer: http://www.example.org/asdf
151 # Expect Header = Referer: http://www.privoxy.org/
152 TAG:^hide-referrer\{http://www.privoxy.org/\}$
155 #TAG:^hide-referrer\{\}$
157 #######################################################
158 # Test hide-user-agent{}.
159 #######################################################
161 {+hide-user-agent{Mozilla/5.0 (X11; U; FreeBSD alpha; en-GB; rv:1.8.1.6) Gecko/20070913 Firefox/2.0.0.6}}
162 # Set Header = User-Agent: Mozilla/5.0 (X11; U; NetBSD i386; de-CH; rv:1.8.1.6) Gecko/20070806 Firefox/2.0.0.6
163 # Expect Header = User-Agent: Mozilla/5.0 (X11; U; FreeBSD alpha; en-GB; rv:1.8.1.6) Gecko/20070913 Firefox/2.0.0.6
164 TAG:^hide-user-agent\{Mozilla/5\.0 \(X11; U; FreeBSD alpha; en-GB; rv:1\.8\.1\.6\) Gecko/20070913 Firefox/2\.0\.0\.6\}$
166 {+hide-user-agent{block}}
167 # XXX: Check the code that is tested here.
168 # Set Header = ua-blah: blah
169 # Expect Header = REMOVAL
170 TAG:^hide-user-agent{block}$
173 # Set Header = ua-blah: blah
174 # Expect Header = NO CHANGE
175 TAG:^-hide-user-agent{block}$
178 #######################################################
180 #######################################################
182 {+add-header{X-Custom-Header: yes, please}}
183 # Set Header = X-Whatever: foo
184 # Expect Header = X-Custom-Header: yes, please
185 TAG:^add-header\{X-Custom-Header: yes, please\}$
187 #######################################################
188 # Test client-header-filter{hide-tor-exit-notation}.
189 #######################################################
191 {+client-header-filter{hide-tor-exit-notation} -hide-referer}
192 # Set Header = Referer: http://p.p.zwiebelsuppe.exit/
193 # Expect Header = Referer: http://p.p/
195 # Set Header = Referer: http://p.p.zwiebelsuppe.exit/foo/bar/baaz/
196 # Expect Header = Referer: http://p.p/foo/bar/baaz/
198 # Set Header = Referer: http://p.p/
199 # Expect Header = NO CHANGE
201 # Set Header = Referer: http://config.privoxy.org.zwiebelsuppe.exit/foo/bar/baaz.html
202 # Expect Header = Referer: http://config.privoxy.org/foo/bar/baaz.html
204 # Set Header = Host: p.p.zwiebelsuppe.exit
205 # Expect Header = Host: p.p
207 # Set Header = Host: p.p
208 # Expect Header = NO CHANGE
210 # Set Header = Referer: http://config.privoxy.org.ad356ef8e87a89e6c898b74500d58607ac691178.exit/foo/baaz.html
211 # Expect Header = Referer: http://config.privoxy.org/foo/baaz.html
212 TAG:^client-header-filter\{hide-tor-exit-notation\}$
214 #######################################################
215 # Test client-header-filter{no-brotli-accepted}.
216 #######################################################
218 {+client-header-filter{no-brotli-accepted}}
219 # Set Header = Accept-Encoding: gzip, deflate, br
220 # Expect Header = Accept-Encoding: gzip, deflate
222 # Set Header = Accept-Encoding: gzip, br, deflate
223 # Expect Header = Accept-Encoding: gzip, deflate
225 # Set Header = Accept-Encoding: br, gzip, deflate
226 # Expect Header = Accept-Encoding: gzip, deflate
228 # Set Header = Accept-Encoding: br
229 # Expect Header = Accept-Encoding:
231 # Set Header = Accept-Encoding: gzip, deflate
232 # Expect Header = NO CHANGE
234 TAG:^client-header-filter\{no-brotli-accepted\}$
236 #######################################################
237 # Test crunch-client-header{}.
238 #######################################################
240 {+crunch-client-header{text/html}}
241 # Set Header = Content-Type: text/html
242 # Expect Header = REMOVAL
244 # Set Header = Content-Type: text/html; charset=4711
245 # Expect Header = REMOVAL
247 # Set Header = Content-Type: text/plain
248 # Expect Header = NO CHANGE
249 TAG:^crunch-client-header\{text/plain\}$
251 #######################################################
252 # Test crunch-if-none-match.
253 #######################################################
255 {+crunch-if-none-match -hide-if-modified-since}
256 # Set Header = If-None-Match: 8987afd239d2093kd2309kd
257 # Expect Header = REMOVAL
259 # Set Header = If-None-Match: 82c3cb50c984ef11b1fed749949b2a16
260 # Expect Header = REMOVAL
262 # Set Header = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
263 # Expect Header = NO CHANGE
264 TAG:^crunch-if-none-match$
266 #######################################################
267 # Test hide-if-modified-since
268 #######################################################
270 {+hide-if-modified-since{block} -crunch-if-none-match}
271 # Set Header = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
272 # Expect Header = REMOVAL
274 # Set Header = If-None-Match: 82c3cb50c984ef11b1fed749949b2a16
275 # Expect Header = NO CHANGE
276 TAG:^hide-if-modified-since\{block\}$
278 {+hide-if-modified-since{-60} -crunch-if-none-match}
279 # Set Header = If-Modified-Since: Gee, this date is invalid
280 # Expect Header = REMOVAL
282 # Set Header = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
283 # Expect Header = SOME CHANGE
284 # Set Header = If-Modified-Since: Thu, 04-Oct-07 09:56:35 GMT
285 # Expect Header = SOME CHANGE
286 # Set Header = If-Modified-Since: Thursday, 04-Oct-2007 09:56:35 GMT
287 # Expect Header = SOME CHANGE
288 # Set Header = If-Modified-Since: Thu, 04-Oct-2007 09:56:35 GMT
289 # Expect Header = SOME CHANGE
290 # Set Header = If-Modified-Since: Thursday Oct 04 09:56:35 2007 GMT
291 # Expect Header = SOME CHANGE
293 # Set Header = If-Modified-Since: Thu, 1 Jan 1970 00:00:00 GMT
294 # Expect Header = SOME CHANGE
296 # Set Header = If-Modified-Since: Thu, 01-Jan-70 00:00:00 GMT
297 # Expect Header = SOME CHANGE
299 # Set Header = If-Modified-Since: Thursday, 01-Jan-1970 00:00:00 GMT
300 # Expect Header = SOME CHANGE
302 # Set Header = If-Modified-Since: Thu, 01-Jan-1970 00:00:00 GMT
303 # Expect Header = SOME CHANGE
305 # Set Header = If-Modified-Since: Thursday Jan 01 00:00:00 1970 GMT
306 # Expect Header = SOME CHANGE
309 # Set Header = If-Modified-Since: Thu, 1 Jan 123456789 00:00:00 GMT
310 # Expect Header = REMOVAL
311 # Set Header = If-Modified-Since: Thu, 01-Jan-123456789 00:00:00 GMT
312 # Expect Header = REMOVAL
313 # Set Header = If-Modified-Since: Thursday, 01-Jan-123456789 00:00:00 GMT
314 # Expect Header = REMOVAL
315 # Set Header = If-Modified-Since: Thu, 01-Jan-123456789 00:00:00 GMT
316 # Expect Header = REMOVAL
317 # Set Header = If-Modified-Since: Thursday Jan 01 00:00:00 123456789 GMT
318 # Expect Header = REMOVAL
320 # Set Header = If-Modified-Since: Mon, 1 Jan 2525 00:00:00 GMT
321 # Expect Header = SOME CHANGE
323 # Set Header = If-Modified-Since: Mon, 01-Jan-25 00:00:00 GMT
324 # Expect Header = SOME CHANGE
326 # Set Header = If-Modified-Since: Monday, 01-Jan-2525 00:00:00 GMT
327 # Expect Header = SOME CHANGE
329 # Set Header = If-Modified-Since: Mon, 01-Jan-2525 00:00:00 GMT
330 # Expect Header = SOME CHANGE
332 # Set Header = If-Modified-Since: Monday Jan 01 00:00:00 2525 GMT
333 # Expect Header = SOME CHANGE
336 # Set Header = If-Modified-Since: Thu, 1 Jan 1970 02:00:00 GMT
337 # Expect Header = SOME CHANGE
338 # Set Header = If-Modified-Since: Thu, 01-Jan-70 02:00:00 GMT
339 # Expect Header = SOME CHANGE
340 # Set Header = If-Modified-Since: Thursday, 01-Jan-1970 02:00:00 GMT
341 # Expect Header = SOME CHANGE
342 # Set Header = If-Modified-Since: Thu, 01-Jan-1970 02:00:00 GMT
343 # Expect Header = SOME CHANGE
344 # Set Header = If-Modified-Since: Thursday Jan 01 02:00:00 1970 GMT
345 # Expect Header = SOME CHANGE
346 TAG:^hide-if-modified-since\{-60\}$
348 {+hide-if-modified-since{+60} -crunch-if-none-match}
349 # Set Header = If-Modified-Since: Gee, this date is invalid
350 # Expect Header = REMOVAL
351 # Set Header = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
352 # Expect Header = SOME CHANGE
353 # Set Header = If-Modified-Since: Wed, 31 Dec 1969 23:59:59 GMT
354 # Expect Header = SOME CHANGE
356 TAG:^hide-if-modified-since\{\+60\}$
358 {+hide-if-modified-since{60} -crunch-if-none-match}
359 # Set Header = If-Modified-Since: Gee, this date is invalid
360 # Expect Header = REMOVAL
361 # Set Header = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
362 # Expect Header = SOME CHANGE
363 TAG:^hide-if-modified-since\{60\}$
365 {+hide-if-modified-since{+0} -crunch-if-none-match}
366 # Set Header = If-Modified-Since: Gee, this date is invalid
367 # Expect Header = REMOVAL
368 # Set Header = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
369 # Expect Header = NO CHANGE
370 TAG:^hide-if-modified-since\{\+0\}$
372 {+hide-if-modified-since{-0} -crunch-if-none-match}
373 # Set Header = If-Modified-Since: Gee, this date is invalid
374 # Expect Header = REMOVAL
375 # Set Header = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
376 # Expect Header = NO CHANGE
377 TAG:^hide-if-modified-since\{-0\}$
379 {+hide-if-modified-since{0} -crunch-if-none-match}
380 # Set Header = If-Modified-Since: Gee, this date is invalid
381 # Expect Header = REMOVAL
382 # Set Header = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
383 # Expect Header = NO CHANGE
384 TAG:^hide-if-modified-since\{0\}$
386 {+hide-if-modified-since{NaN} -crunch-if-none-match}
387 # Set Header = If-Modified-Since: Gee, this date is invalid
388 # Expect Header = REMOVAL
389 # Set Header = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
390 # Expect Header = NO CHANGE
391 TAG:^hide-if-modified-since\{NaN\}$
394 #######################################################
395 # Test crunch-outgoing-cookies
396 #######################################################
399 +crunch-outgoing-cookies \
400 -crunch-incoming-cookies \
401 -limit-cookie-lifetime \
402 -session-cookies-only \
403 -hide-if-modified-since \
405 # Set Header = If-Modified-Since: Gee, this date is invalid
406 # Expect Header = NO CHANGE
408 # Set Header = Cookie: PREF=ID=6cf0abd34262:TM=117335617:LM=1617:S=jZypyJ7LPiwFi1_
409 # Expect Header = REMOVAL
410 TAG:^crunch-outgoing-cookies$
412 #######################################################
413 # Test session-cookies-only
415 # XXX: pretty useless as session-cookies-only doesn't
416 # affect client headers.
417 #######################################################
420 -crunch-outgoing-cookies \
421 -crunch-incoming-cookies \
422 -limit-cookie-lifetime \
423 +session-cookies-only \
424 -hide-if-modified-since \
426 # Set Header = Cookie: NSC_gffe-iuuq-mc-wtfswfs=8efb330d3660;expires=Thu, 04-Oct-07 19:11:34 GMT;path=/
427 # Expect Header = NO CHANGE
429 # Set Header = Cookie: PREF=ID=6cf0abd34262:TM=117335617:LM=1617:S=jZypyJ7LPiwFi1_
430 # Expect Header = NO CHANGE
431 TAG:^session-cookies-only$
433 #######################################################
434 # Test change-x-forwarded-for
435 #######################################################
438 -change-x-forwarded-for \
440 # Set Header = X-Forwarded-For: 10.0.0.1
441 # Expect Header = NO CHANGE
442 TAG:^-change-x-forwarded-for$
445 +change-x-forwarded-for{block} \
447 # Set Header = X-Forwarded-For: 10.0.0.1
448 # Expect Header = REMOVAL
449 TAG:^change-x-forwarded-for\{block\}$
452 +change-x-forwarded-for{add} \
454 # Set Header = X-Forwarded-For: 10.0.0.1
455 # Expect Header = SOME CHANGE
456 TAG:^change-x-forwarded-for\{add\}$
458 #######################################################
459 # Test hide-from-header
460 #######################################################
463 +hide-from-header{block}\
465 # Set Header = From: schneewitchen@example.org
466 # Expect Header = REMOVAL
467 TAG:^hide-from-header\{block\}$
470 +hide-from-header{siebenzwerge@example.org}\
472 # Set Header = From: schneewitchen@example.org
473 # Expect Header = From: siebenzwerge@example.org
474 TAG:^hide-from-header\{siebenzwerge@example.org\}$
476 #######################################################
477 # Test prevent-compression
478 #######################################################
481 +prevent-compression\
483 # Set Header = Accept-Encoding: gzip, deflate
484 # Expect Header = REMOVAL
486 # Set Header = Accept-Encoding: gzip
487 # Expect Header = REMOVAL
489 # Set Header = Accept-Encoding: deflate
490 # Expect Header = REMOVAL
491 TAG:^prevent-compression$
493 #######################################################
494 # Test content filters which could cause problems with
496 #######################################################
499 -client-header-tagger{range-requests} \
500 +deanimate-gifs{last} \
503 # Set Header = Range: bytes=1234-5678
504 # Expect Header = REMOVAL
505 # Set Header = Range: bytes=1-5
506 # Expect Header = REMOVAL
507 # Set Header = If-Range: bytes=1234-5678
508 # Expect Header = REMOVAL
509 # Set Header = Request-Range: bytes=1234-5678
510 # Expect Header = REMOVAL
511 # Set Header = Range: foo
512 # Expect Header = REMOVAL
513 # Set Header = If-Range: foo
514 # Expect Header = REMOVAL
515 # Set Header = Request-Range: foo
516 # Expect Header = REMOVAL
517 # Set Header = Range: bytes=0-5678
518 # Expect Header = NO CHANGE
519 # Set Header = Range: bytes=0-
520 # Expect Header = NO CHANGE
521 # Set Header = If-Range: bytes=0-5678
522 # Expect Header = NO CHANGE
523 # Set Header = If-Range: bytes=0-
524 # Expect Header = NO CHANGE
525 # Set Header = Request-Range: bytes=0-5678
526 # Expect Header = NO CHANGE
527 # Set Header = Request-Range: bytes=0-
528 # Expect Header = NO CHANGE
529 TAG:^deanimate-gifs\{last\}$
532 -client-header-tagger{range-requests} \
534 +filter{banners-by-size} \
536 # Set Header = Range: bytes=1234-5678
537 # Expect Header = REMOVAL
538 # Set Header = Range: bytes=1-5
539 # Expect Header = REMOVAL
540 # Set Header = If-Range: bytes=1234-5678
541 # Expect Header = REMOVAL
542 # Set Header = Request-Range: bytes=1234-5678
543 # Expect Header = REMOVAL
544 # Set Header = Range: bytes=1-5
545 # Expect Header = REMOVAL
546 # Set Header = If-Range: bytes=1234-5678
547 # Expect Header = REMOVAL
548 # Set Header = Request-Range: bytes=1234-5678
549 # Expect Header = REMOVAL
550 # Set Header = Range: foo
551 # Expect Header = REMOVAL
552 # Set Header = If-Range: foo
553 # Expect Header = REMOVAL
554 # Set Header = Request-Range: foo
555 # Expect Header = REMOVAL
556 # Set Header = Range: bytes=0-5678
557 # Expect Header = NO CHANGE
558 # Set Header = Range: bytes=0-
559 # Expect Header = NO CHANGE
560 # Set Header = If-Range: bytes=0-5678
561 # Expect Header = NO CHANGE
562 # Set Header = If-Range: bytes=0-
563 # Expect Header = NO CHANGE
564 # Set Header = Request-Range: bytes=0-5678
565 # Expect Header = NO CHANGE
566 # Set Header = Request-Range: bytes=0-
567 # Expect Header = NO CHANGE
568 TAG:^filter\{banners-by-size\}$
571 -client-header-tagger{range-requests} \
575 # Set Header = Range: bytes=1234-5678
576 # Expect Header = NO CHANGE
577 # Set Header = If-Range: bytes=1234-5678
578 # Expect Header = NO CHANGE
579 # Set Header = Request-Range: bytes=1234-5678
580 # Expect Header = NO CHANGE
581 TAG:^no-content-filter$
584 # Set Header = Connection: keep-alive
585 # Expect Header = NO CHANGE
587 # Set Header = Connection:
588 # Expect Header = REMOVAL
590 TAG:^Connection: keep-alive$
593 # Set Header = Connection: keep-alive
594 # Expect Header = Connection: close
596 # Set Header = Connection:
597 # Expect Header = Connection: close
599 TAG:^Connection: close$
602 # Set Header = Connection: close
603 # Expect Header = NO CHANGE
605 TAG:^connection-sharing disabled$
608 # Set Header = Connection: close
609 # Expect Header = REMOVAL
611 # Set Header = Connection: keep-alive
612 # Expect Header = NO CHANGE
614 TAG:^connection-sharing enabled$
617 # XXX: Removing a header by not specifying a value is
618 # an inherited curl feature and could be viewed as a
619 # bug as far as Privoxy-Regression-Test is concerned.
622 # Expect Header = Host: p.p
626 # Set Header = Host: whatever.example.org
627 # Expect Header = NO CHANGE
628 TAG:^Host header other than the target host$
631 # Set Header = Keep-Alive: 20
632 # Expect Header = NO CHANGE
634 # Set Header = Keep-Alive: timeout=20, max=3
635 # Expect Header = NO CHANGE
637 # Set Header = Keep-Alive: blah=fasel, timeout=20, max=3
638 # Expect Header = NO CHANGE
640 # Set Header = Keep-Alive: timeuot=20, max=3
641 # Expect Header = REMOVAL
643 # Set Header = Keep-Alive: twenty seconds please
644 # Expect Header = REMOVAL
646 TAG:^Parse Keep-Alive header$
649 # Set Header = Keep-Alive: 20
650 # Expect Header = REMOVAL
652 # Set Header = Keep-Alive: timeout=20, max=3
653 # Expect Header = REMOVAL
655 # Set Header = Keep-Alive: blah=fasel, timeout=20, max=3
656 # Expect Header = REMOVAL
658 TAG:^Keep-Alive header removal$
661 # XXX: check the RFC to use a real value
662 # Set Header = proxy-connection: keep-alive
663 # Expect Header = REMOVAL
664 TAG:^Proxy-Connection removal$
667 # Set Header = Proxy-Connection: keep-alive
668 # Expect Header = REMOVAL
669 TAG:^Proxy-Connection removal$
672 # These are somewhat redundant when testing with
673 # GET requests, but I want to remember then when
674 # TRACE requests are supported.
676 # Set Header = Max-Forwards: 0
677 # Expect Header = NO CHANGE
678 # Set Header = Max-Forwards: 1
679 # Expect Header = NO CHANGE
680 # Set Header = Max-Forwards: -1
681 # Expect Header = NO CHANGE
682 # Set Header = Max-Forwards: 3
683 # Expect Header = NO CHANGE
684 TAG:^Max-Forwards header without TRACE method$
687 # Set Header = Proxy-Authorization: blafaseldieda
688 # Expect Header = REMOVAL
690 TAG:^Proxy-Authorization header removal$
693 # Set Header = Proxy-Authorization: blafaseldieda
694 # Expect Header = Proxy-Authorization: blafaseldieda
696 TAG:^Proxy-Authorization header forwarding$
698 ################################################################
700 # Fairly dumb tests for Privoxy CGI pages.
702 # These are mainly useful for checking for memory leaks
703 # with Valgrind or whether or not the user manual is installed
706 # Note that if "Expect Status Code" is missing, 200 is implied.
708 ################################################################
710 # Fetch Test = http://p.p/
711 # Fetch Test = http://p.p/die
712 # Expect Status Code = 404
714 # Fetch Test = http://p.p/die
715 # Expect Status Code = 200
717 # Fetch Test = http://p.p/show-status
718 # Fetch Test = http://config.privoxy.org/show-status?file=actions&index=0
719 # Fetch Test = http://config.privoxy.org/show-status?file=filter&index=0
720 # XXX: for the invalid ones we probably shouldn't return status code 200.
721 # Fetch Test = http://config.privoxy.org/show-status?file=actions&index=100
722 # Fetch Test = http://config.privoxy.org/show-status?file=actions&index=NaN
723 # Fetch Test = http://config.privoxy.org/show-status?file=actions
724 # Fetch Test = http://config.privoxy.org/show-status?file=filter&index=100
725 # Fetch Test = http://config.privoxy.org/show-status?file=filter&index=NaN
726 # Fetch Test = http://config.privoxy.org/show-status?file=filter
727 # Fetch Test = http://config.privoxy.org/show-status?file=invalid
728 # Fetch Test = http://config.privoxy.org/show-status?file=trust
729 # Fetch Test = http://p.p/show-version
730 # Expect Status Code = 404
731 # Fetch Test = http://p.p/show-request
732 # Fetch Test = http://p.p/show-url-info
733 # Fetch Test = http://p.p/show-url-info?url=www.privoxy.org%2F
734 # Fetch Test = http://p.p/show-url-info?url=http:%2F%2Fwww.privoxy.org%2F
735 # Fetch Test = http://p.p/show-url-info?url=HTTp:%2F%2Fwww.privoxy.org%2F
736 # Fetch Test = http://p.p/show-url-info?url=https:%2F%2Fwww.privoxy.org%2F
737 # Fetch Test = http://p.p/show-url-info?url=HtTps:%2F%2Fwww.privoxy.org%2F
738 # Fetch Test = http://p.p/show-url-info?url=ftp:%2F%2Fwww.privoxy.org%2F
739 # Fetch Test = http://p.p/show-url-info?url=FTp:%2F%2Fwww.privoxy.org%2F
740 # Fetch Test = http://p.p/show-url-info?url=
741 # Fetch Test = http://p.p/show-url-info?url=%2F
742 # Depends on FEATURE_TOGGLE
743 # Fetch Test = http://p.p/toggle
745 # Fetch Test = http://p.p/toggle
746 # Expect Status Code = 403
748 # Fetch Test = http://p.p/edit-actions
749 # Expect Status Code = 403
751 # Fetch Test = http://p.p/eaa
752 # Expect Status Code = 403
754 # Fetch Test = http://p.p/eau
755 # Expect Status Code = 403
757 # Fetch Test = http://p.p/ear
758 # Expect Status Code = 403
760 # Fetch Test = http://p.p/eal
761 # Expect Status Code = 403
763 # Fetch Test = http://p.p/eafu
764 # Expect Status Code = 403
766 # Fetch Test = http://p.p/eas
767 # Expect Status Code = 403
769 # Fetch Test = http://p.p/easa
770 # Expect Status Code = 403
772 # Fetch Test = http://p.p/easr
773 # Expect Status Code = 403
775 # Fetch Test = http://p.p/eass
776 # Expect Status Code = 403
778 # Fetch Test = http://p.p/edit-actions-for-url
779 # Expect Status Code = 403
781 # Fetch Test = http://p.p/edit-actions-list
783 # Fetch Test = http://p.p/edit-actions-submit
784 # Expect Status Code = 403
786 # Expect Status Code = 403
787 # Fetch Test = http://p.p/edit-actions-url
788 # Expect Status Code = 403
790 # Fetch Test = http://p.p/edit-actions-url-form
791 # Expect Status Code = 403
793 # Fetch Test = http://p.p/edit-actions-add-url
794 # Expect Status Code = 403
796 # Fetch Test = http://p.p/edit-actions-add-url-form
797 # Expect Status Code = 403
799 # Fetch Test = http://p.p/edit-actions-remove-url
800 # Expect Status Code = 403
802 # Fetch Test = http://p.p/edit-actions-remove-url-form
803 # Expect Status Code = 403
805 # Fetch Test = http://p.p/edit-actions-section-add
806 # Expect Status Code = 403
808 # Fetch Test = http://p.p/edit-actions-section-remove
809 # Expect Status Code = 403
811 # Fetch Test = http://p.p/edit-actions-section-swap
812 # Expect Status Code = 403
814 # Fetch Test = http://p.p/error-favicon.ico
815 # Fetch Test = http://p.p/favicon.ico
816 # Fetch Test = http://p.p/robots.txt
817 # Fetch Test = http://p.p/send-banner
818 # Trusted CGI Request = http://p.p/send-stylesheet
819 # Fetch Test = http://p.p/send-stylesheet
820 # Expect Status Code = 403
821 # Fetch Test = http://p.p/t
822 # Fetch Test = http://p.p/url-info-osd.xml
823 # Fetch Test = http://p.p/client-tags
825 # Trusted CGI Request = http://p.p/toggle-client-tag
826 # Expect Status Code = 302
828 # Fetch Test = http://p.p/toggle-client-tag
829 # Expect Status Code = 403
832 # Trusted CGI Request = http://p.p/edit-actions
833 # Expect Status Code = 302
834 # Level = 12 # Depends on the CGI editor being enabled
835 # Fetch Test = http://p.p/does-not-exist
836 # Expect Status Code = 404
837 # Trusted CGI Request = http://p.p/eaa
839 # Trusted CGI Request = http://p.p/eau
841 # Trusted CGI Request = http://p.p/ear
843 # Trusted CGI Request = http://p.p/eal
845 # Trusted CGI Request = http://p.p/eafu
847 # Trusted CGI Request = http://p.p/eas
849 # Trusted CGI Request = http://p.p/easa
851 # Trusted CGI Request = http://p.p/easr
853 # Trusted CGI Request = http://p.p/eass
855 # Trusted CGI Request = http://p.p/edit-actions-for-url
857 # Trusted CGI Request = http://p.p/edit-actions-list
859 # Trusted CGI Request = http://p.p/edit-actions-submit
861 # Trusted CGI Request = http://p.p/edit-actions-url
863 # Trusted CGI Request = http://p.p/edit-actions-url-form
865 # Trusted CGI Request = http://p.p/edit-actions-add-url
867 # Trusted CGI Request = http://p.p/edit-actions-add-url-form
869 # Trusted CGI Request = http://p.p/edit-actions-remove-url
871 # Trusted CGI Request = http://p.p/edit-actions-remove-url-form
873 # Trusted CGI Request = http://p.p/edit-actions-section-add
875 # Trusted CGI Request = http://p.p/edit-actions-section-remove
877 # Trusted CGI Request = http://p.p/edit-actions-section-swap
879 # Trusted CGI Request = http://p.p/send-stylesheet
881 # The following tests depend on Privoxy being configured to deliver the user manual
883 # Fetch Test = http://p.p/user-manual
884 # Expect Status Code = 302
886 # Fetch Test = http://p.p/user-manual/
888 # Fetch Test = http://p.p/user-manual/actions-file.html
890 # Fetch Test = http://p.p/user-manual/appendix.html
892 # Fetch Test = http://p.p/user-manual/config.html
894 # Fetch Test = http://p.p/user-manual/configuration.html
896 # Fetch Test = http://p.p/user-manual/contact.html
898 # Fetch Test = http://p.p/user-manual/copyright.html
900 # Fetch Test = http://p.p/user-manual/files-in-use.jpg
902 # Fetch Test = http://p.p/user-manual/filter-file.html
904 # Fetch Test = http://p.p/user-manual/index.html
906 # Fetch Test = http://p.p/user-manual/installation.html
908 # Fetch Test = http://p.p/user-manual/introduction.html
910 # Fetch Test = http://p.p/user-manual/p_doc.css
912 # Fetch Test = http://p.p/user-manual/proxy2.jpg
914 # Fetch Test = http://p.p/user-manual/proxy_setup.jpg
916 # Fetch Test = http://p.p/user-manual/quickstart.html
918 # Fetch Test = http://p.p/user-manual/seealso.html
920 # Fetch Test = http://p.p/user-manual/startup.html
922 # Fetch Test = http://p.p/user-manual/templates.html
924 # Fetch Test = http://p.p/user-manual/whatsnew.html
928 # Method Test = OPTIONS
935 # Method Test = DELETE
936 # Method Test = OPTIONS
937 # Method Test = TRACE
938 # Method Test = CONNECT
940 # Method Test = PROPFIND
941 # Method Test = PROPPATCH
944 # Method Test = MKCOL
946 # Method Test = UNLOCK
947 # Method Test = BCOPY
948 # Method Test = BMOVE
949 # Method Test = BDELETE
950 # Method Test = BPROPFIND
951 # Method Test = BPROPPATCH
952 # Method Test = SUBSCRIBE
953 # Method Test = UNSUBSCRIBE
954 # Method Test = NOTIFY
956 # Method Test = VERSION-CONTROL
957 # Method Test = REPORT
958 # Method Test = CHECKOUT
959 # Method Test = CHECKIN
960 # Method Test = UNCHECKOUT
961 # Method Test = MKWORKSPACE
962 # Method Test = UPDATE
963 # Method Test = LABEL
964 # Method Test = MERGE
965 # Method Test = BASELINE-CONTROL
966 # Method Test = MKACTIVITY
967 # Method Test = PATCH
968 # Method Test = PRIVOXY-REGRESSION-TEST-IN-THE-HOUSE
969 # Expect Status Code = 400
971 {+block{Forbidden Port. You are not supposed to see this.}}
972 config.privoxy.org:1-/
976 config.privoxy.org:3,79-81/
979 {+forward-override{forward-socks5 127.0.0.1:12345 .}}
980 # Fetch Test = http://oh-dear-this-hostname-is-so-very-long-that-it-can-not-possibly-be-forwarded-through-socks5-as-a-result-we-therefore-expect-privoxy-to-return-an-error-response-instead-of-forwarding-the-request-because-as-already-mentioned-this-host-is-really-very-long.example
981 # Expect Status Code = 503
982 oh-dear-this-hostname-is-so-very-long-that-it-can-not-possibly-be-forwarded-through-socks5-as-a-result-we-therefore-expect-privoxy-to-return-an-error-response-instead-of-forwarding-the-request-because-as-already-mentioned-this-host-is-really-very-long.example/
984 {+forward-override{forward-socks5 127.0.0.1:12345 .}}
985 # Fetch Test = http://oh-dear-this-hostname-is-short-enough-but-there-is-no-socks5-server-listening.example
986 # Expect Status Code = 503
987 oh-dear-this-hostname-is-short-enough-but-there-is-no-socks5-server-listening.example
989 {+forward-override{forward-socks4 127.0.0.1:12345 .}}
990 # Fetch Test = http://oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4-server-listening.example
991 # Expect Status Code = 503
992 oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4-server-listening.example
994 {+forward-override{forward-socks4a 127.0.0.1:12345 .}}
995 # Fetch Test = http://oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4a-server-listening.example
996 # Expect Status Code = 503
997 oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4a-server-listening.example
999 {+forward-override{forward-socks5 127.0.0.1:-1 127.0.0.1:12345}}
1000 # This one currently triggers the same error condition as the
1001 # test above (socks5 server unreachable), but once Privoxy
1002 # starts to properly reject invalid ports it should become useful.
1004 # Fetch Test = http://invalid-forward5-gateway-port.example
1005 # Expect Status Code = 503
1006 invalid-forward5-gateway-port.example
1008 {+forward-override{forward-socks5 :12345 127.0.0.1:12345}}
1009 # Fetch Test = http://forward5-null-gateway-host.example
1010 # Expect Status Code = 503
1011 forward5-null-gateway-host.example
1013 {+limit-connect{443}}
1014 # Fetch Test = http://www.forbidden-connect.example:444/
1016 # Expect Status Code = 403
1017 www.forbidden-connect.example/
1019 {+block{This request failed to make it to the target destination which means the test succeeded.}}
1020 # Fetch Test = http://www.blocked-request.example/blocked-request
1021 # Expect Status Code = 403
1022 www.blocked-request.example/blocked-request
1025 # Fetch Test = http://www.blocked-request.example/blocked-request-with-no-reason-specified
1026 # Expect Status Code = 403
1027 www.blocked-request.example/blocked-request-with-no-reason-specified
1029 # Some domain pattern tests
1031 {+block{domain pattern test}}
1032 # Blocked URL = http://domain-pattern-test.example/
1033 # Blocked URL = http://domain-pattern-test.example.org/
1034 domain-pattern-test.example.
1036 {+block{Hostname patterns without trailing dots cover hostnames with trailing dots as well.}}
1037 # Blocked URL = http://trailing-dot.example.org./
1038 # Blocked URL = http://trailing-dot.example.org./foo
1039 trailing-dot.example.org
1042 # Just in case there is no white-space fuzzer in the house ...
1044 # Set Header = X-LWS-Test: no superfluous white space here
1045 # Expect Header = NO CHANGE
1046 # Set Header = X-LWS-Test: superfluous white space in the house
1047 # Expect Header = X-LWS-Test: superfluous white space in the house
1048 # Set Header = X-LWS-Test : superfluous white space in the house
1049 # Expect Header = X-LWS-Test: superfluous white space in the house
1050 # Set Header = X-LWS-Test: :superfluous white space in the house
1051 # Expect Header = X-LWS-Test: :superfluous white space in the house
1052 # Set Header = X-LWS-Test: :no superfluous white space here
1053 # Expect Header = NO CHANGE
1054 # Set Header = X-LWS-Test: superfluous white tabs in the house
1055 # Expect Header = X-LWS-Test: superfluous white tabs in the house
1056 # Set Header = X-LWS-Test : superfluous white tabs in the house
1057 # Expect Header = X-LWS-Test: superfluous white tabs in the house
1058 # Set Header = X-LWS-Test: "leave quoted lws alone"
1059 # Expect Header = X-LWS-Test: "leave quoted lws alone"
1060 # Set Header = X-LWS-Test: "leave quoted lws alone" thxbye
1061 # Expect Header = X-LWS-Test: "leave quoted lws alone" thxbye
1062 # Set Header = X-LWS-Test: " Do I Look like quoted text? Me thinks not.
1063 # Expect Header = X-LWS-Test: " Do I Look like quoted text? Me thinks not.
1064 # Set Header = X-LWS-Test: "This is quoted" this is not "but this is again"
1065 # Expect Header = X-LWS-Test: "This is quoted" this is not "but this is again"
1066 # Set Header = X-LWS-Test: "This is quoted" this is not "this is " but " this again is not
1067 # Expect Header = X-LWS-Test: "This is quoted" this is not "this is " but " this again is not
1070 {+fast-redirects{check-decoded-url}}
1071 # Redirected URL = http://redirect.example.net/blafasel&url=http://redirected1.example.net/
1072 # Redirect Destination = http://redirected1.example.net/
1073 # Redirected URL = http://redirect.example.net/blafasel&url=http%3A%2F%2Fredirected2.example.net%2F¶meter=not-part-of-the-redirected-url
1074 # Redirect Destination = http://redirected2.example.net/
1075 # Redirected URL = http://redirect.example.net/blafasel&url=http%3A%2F%2Fredirected3.example.net%2F¶meter=not-part-of-the-redirected-url
1076 # Redirect Destination = http://redirected3.example.net/
1077 # Redirected URL = http://redirect.example.net/blafasel&url=http%3A%2F%2Fredirected4.example.net%2F%26parameter=part-of-the-redirected-url
1078 # Redirect Destination = http://redirected4.example.net/¶meter=part-of-the-redirected-url
1079 # Redirected URL = http://redirect.example.net/blafasel&url1=http%3A%2F%2Fredirected5.example.net%2F%26parameter1=part-of-the-redirected-url&url2=http%3A%2F%2Fredirected5.example.net%2F%26parameter2=part-of-the-redirected-url2
1080 # Redirect Destination = http://redirected5.example.net/¶meter2=part-of-the-redirected-url2
1081 # Redirected URL = http://redirect.example.net/blafasel&url1=http%3A%2F%2Fredirected6.example.net%2F%26parameter1=part-of-the-redirected-url&url2=http%3A%2F%2Fredirected6.example.net%2F%26parameter2=part-of-the-redirected-url2¶meter3=not-part-of-the-redirected-url2
1082 # Redirect Destination = http://redirected6.example.net/¶meter2=part-of-the-redirected-url2
1083 # Redirected URL = http://redirect.example.net/blafasel?x=http%3A%2F%2Fredirected7.example.net%2F%26parameter1=part-of-the-redirected-url1¶meter2=not-part-of-the-redirected-url1
1084 # Redirect Destination = http://redirected7.example.net/¶meter1=part-of-the-redirected-url1
1085 # Redirected URL = http://redirect.example.net/blafasel?x=http%3A%2F%2Fredirected8.example.net%2F%26parameter1=part-of-the-redirected-url1¶meter2=not-part-of-the-redirected-url1¶meter3=not-part-of-the-redirected-url1
1086 # Redirect Destination = http://redirected8.example.net/¶meter1=part-of-the-redirected-url1
1087 # Redirected URL = http://redirect.example.net/blafasel?a?b?c?d?e?f?g?h?i?j?k?l?m?n?o?p?q?r?s&t&u&v&w&x&y&z&1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16x=http%3A%2F%2Fredirected8.example.net%2F%26parameter1=part-of-the-redirected-url1¶meter2=not-part-of-the-redirected-url1¶meter3=not-part-of-the-redirected-url1
1088 # Redirect Destination = http://redirected8.example.net/¶meter1=part-of-the-redirected-url1
1089 # Redirected URL = http://redirect.example.net/blafasel???????????????????????????????=http%3A%2F%2Fredirected8.example.net%2F%26parameter1=part-of-the-redirected-url1¶meter2=not-part-of-the-redirected-url1¶meter3=not-part-of-the-redirected-url1
1090 # Redirect Destination = http://redirected8.example.net/¶meter1=part-of-the-redirected-url1
1091 # Redirected URL = http://redirect.example.net/blafasel&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&=http%3A%2F%2Fredirected8.example.net%2F%26parameter1=part-of-the-redirected-url1¶meter2=not-part-of-the-redirected-url1¶meter3=not-part-of-the-redirected-url1
1092 # Redirect Destination = http://redirected8.example.net/¶meter1=part-of-the-redirected-url1
1093 redirect.example.net/
1094 # Redirected URL = http://redirect.example.net/blafaselhttp://redirect1.example.net/http://redirect2.example.net/
1095 # Redirect Destination = http://redirect2.example.net/
1096 # Redirected URL = http://redirect.example.net/blafasel%3A%2F%2Fredirect1.example.net/http://redirect2.example.net/
1097 # Redirect Destination = http://redirect2.example.net/
1098 # Redirected URL = http://redirect.example.net/blafaselhttp://redirect1.example.net/http%3A%2F%2Fredirect2.example.net/
1099 # Redirect Destination = http://redirect2.example.net/
1100 # These tests verify that Privoxy behaves as intended,
1101 # given that the encoded redirect URLs are invalid,
1102 # there are no correct redirect URLs.
1103 # Redirected URL = http://redirect.example.net/%%%%%%%%%%%%%%%%%%%%%%blafaselhttp://redirect1.example.net/http%3A%2F%2Fredirect2.example.net/%%%%%%%%%%%%%%
1104 # Redirect Destination = http://redirect2.example.net/%%%%%%%%%%%%%%
1105 # Redirected URL = http://redirect.example.net/%%%%%%%%%%%%%%%%%%%%%%blafaselhttp://redirect1.example.net/http%3A%2F%2Fredirect2.example.net/%1%2%%3%4%5%6%7%8%9%0%0%%
1106 # Redirect Destination = http://redirect2.example.net/%1%2%%3%4%5%6%7%8%9%0%0%%
1108 {+fast-redirects{simple-check}}
1109 # Redirected URL = http://redirect2.example.net/blafasel?x=http://redirected.example.net/¶meter1=part-of-the-redirected-url1¶meter2=part-of-the-redirected-url1
1110 # Redirect Destination = http://redirected.example.net/¶meter1=part-of-the-redirected-url1¶meter2=part-of-the-redirected-url1
1111 redirect2.example.net/
1113 {+delay-response{1}}
1114 # Fetch Test = http://config.privoxy.org/show-url-info?url=http%3A%2F%2Fwww.example.com%2Fprivoxy-test-delay-response
1115 config.privoxy.org/show-url-info\?url=http%3A%2F%2Fwww\.example\.com%2Fprivoxy-test-delay-response
1117 {+block{Block with pcre host pattern}}
1118 # Blocked URL = http://aaa.example.org/
1120 PCRE-HOST-PATTERN:^a{3}\.example\.org$
1121 # Blocked URL = http://bbb.example.org/
1123 PCRE-HOST-PATTERN:^(bbb|ccc|ddd)\.example\.org$