1 #############################################################################
2 # $Id: regression-tests.action,v 1.54 2014/10/17 14:45:29 fabiankeil Exp $
3 #############################################################################
5 # This is a configuration file for Privoxy-Regression-Test
6 # (included in the source tarball's tools directory).
8 # After referencing it in your Privoxy configuration both Privoxy and
9 # Privoxy-Regression-Test should be good to go.
11 #############################################################################
13 # Copyright (c) 2007-2014 Fabian Keil <fk@fabiankeil.de>
15 # Permission to use, copy, modify, and distribute this software for any
16 # purpose with or without fee is hereby granted, provided that the above
17 # copyright notice and this permission notice appear in all copies.
19 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
20 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
21 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
22 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
23 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
24 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
25 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
27 #############################################################################
30 for-privoxy-version=3.0.22
32 # Some dependencies Privoxy-Regression-Test should know about:
34 # Level 9 needs = config line user-manual\s+(\.?\.?/|[A-Za-z]:)
35 # Level 12 needs = config line enable-edit-actions\s+1
36 # Level 13 needs = feature status FEATURE_CONNECTION_KEEP_ALIVE Yes
37 # Level 13 needs = config line keep-alive-timeout\s+[1-9]+
38 # Level 14 needs = feature status FEATURE_CONNECTION_KEEP_ALIVE No
39 # Level 15 needs = config line connection-sharing\s+0
40 # Level 16 needs = feature status FEATURE_CONNECTION_KEEP_ALIVE Yes
41 # Level 16 needs = config line connection-sharing\s+1
42 # Level 17 needs = feature status FEATURE_PTHREAD Yes
43 # Level 18 needs = feature status FEATURE_GRACEFUL_TERMINATION No
44 # Level 19 needs = feature status FEATURE_GRACEFUL_TERMINATION Yes
45 # Level 20 needs = feature status FEATURE_TOGGLE Yes
46 # Level 21 needs = feature status FEATURE_TOGGLE No
47 # Level 22 needs = config line enable-proxy-authentication-forwarding\s+0
48 # Level 23 needs = config line enable-proxy-authentication-forwarding\s+1
50 #######################################################
51 # Enable taggers to activate the tests on demand
52 # and suppress hiding the User-Agent for
53 # Privoxy-Regression-Test to save log space.
54 #######################################################
56 +client-header-tagger{user-agent} \
57 +client-header-tagger{privoxy-control} \
58 +client-header-filter{privoxy-control} \
65 TAG:^User-Agent: Privoxy-Regression-Test
67 #######################################################
68 # Test accept-language{}.
69 #######################################################
71 {+hide-accept-language{en-gb}}
72 # Set Header = Accept-Language: de-de
73 # Expect Header = Accept-Language: en-gb
74 TAG:^hide-accept-language\{en-gb\}$
76 {+hide-accept-language{block}}
77 # Set Header = Accept-Language: de-de
78 # Expect Header = REMOVAL
79 TAG:^hide-accept-language\{block\}$
81 #######################################################
82 # Sections for hide-referrer{} to test:
84 # 1) conditional-block
85 # 2) conditional-forge
88 # 5) a parameter that looks like a valid fake referrer
89 # 6) a parameter that looks like an invalid fake referrer
90 #######################################################
92 {+hide-referrer{conditional-block}}
93 # Set Header = Referer: http://www.example.org/foo
94 # Expect Header = REMOVAL
96 # Set Header = Referer: http://p.p/foo
97 # Expect Header = NO CHANGE
99 # Set Header = Referer: p.p/
100 # Expect Header = REMOVAL
102 # Set Header = Referer: p
103 # Expect Header = REMOVAL
105 # Set Header = Referer: http://
106 # Expect Header = REMOVAL
108 # Set Header = Referer: https://p.p/
109 # Expect Header = REMOVAL
110 TAG:^hide-referrer\{conditional-block\}$
112 {+hide-referrer{conditional-forge}}
113 # Set Header = Referer: http://www.example.org/foo
114 # Expect Header = Referer: http://p.p/
116 # Set Header = Referer: http://p.p/foo
117 # Expect Header = NO CHANGE
119 # Set Header = Referer: p.p/
120 # Expect Header = Referer: http://p.p/
122 # Set Header = Referer: p
123 # Expect Header = Referer: http://p.p/
125 # Set Header = Referer: http://
126 # Expect Header = Referer: http://p.p/
128 # Set Header = Referer: https://p.p/
129 # Expect Header = Referer: http://p.p/
130 TAG:^hide-referrer\{conditional-forge\}$
132 {+hide-referrer{forge}}
133 # Set Header = Referer: http://www.example.org/foo
134 # Expect Header = Referer: http://p.p/
135 TAG:^hide-referrer\{forge\}$
137 {+hide-referrer{block}}
138 # Set Header = Referer: http://www.example.org/foo
139 # Expect Header = REMOVAL
140 TAG:^hide-referrer\{block\}$
142 {+hide-referrer{invalid}}
143 # Set Header = Referer: http://www.example.org/foo
144 # Expect Header = Referer: invalid
145 TAG:^hide-referrer\{invalid\}$
147 {+hide-referrer{http://www.privoxy.org/}}
148 # Set Header = Referer: http://www.example.org/asdf
149 # Expect Header = Referer: http://www.privoxy.org/
150 TAG:^hide-referrer\{http://www.privoxy.org/\}$
153 #TAG:^hide-referrer\{\}$
155 #######################################################
156 # Test hide-user-agent{}.
157 #######################################################
159 {+hide-user-agent{Mozilla/5.0 (X11; U; FreeBSD alpha; en-GB; rv:1.8.1.6) Gecko/20070913 Firefox/2.0.0.6}}
160 # 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
161 # 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
162 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\}$
164 {+hide-user-agent{block}}
165 # XXX: Check the code that is tested here.
166 # Set Header = ua-blah: blah
167 # Expect Header = REMOVAL
168 TAG:^hide-user-agent{block}$
171 # Set Header = ua-blah: blah
172 # Expect Header = NO CHANGE
173 TAG:^-hide-user-agent{block}$
176 #######################################################
178 #######################################################
180 {+add-header{X-Custom-Header: yes, please}}
181 # Set Header = X-Whatever: foo
182 # Expect Header = X-Custom-Header: yes, please
183 TAG:^add-header\{X-Custom-Header: yes, please\}$
185 #######################################################
186 # Test client-header-filter{hide-tor-exit-notation}.
187 #######################################################
189 {+client-header-filter{hide-tor-exit-notation} -hide-referer}
190 # Set Header = Referer: http://p.p.zwiebelsuppe.exit/
191 # Expect Header = Referer: http://p.p/
193 # Set Header = Referer: http://p.p.zwiebelsuppe.exit/foo/bar/baaz/
194 # Expect Header = Referer: http://p.p/foo/bar/baaz/
196 # Set Header = Referer: http://p.p/
197 # Expect Header = NO CHANGE
199 # Set Header = Referer: http://config.privoxy.org.zwiebelsuppe.exit/foo/bar/baaz.html
200 # Expect Header = Referer: http://config.privoxy.org/foo/bar/baaz.html
202 # Set Header = Host: p.p.zwiebelsuppe.exit
203 # Expect Header = Host: p.p
205 # Set Header = Host: p.p
206 # Expect Header = NO CHANGE
208 # Set Header = Referer: http://config.privoxy.org.ad356ef8e87a89e6c898b74500d58607ac691178.exit/foo/baaz.html
209 # Expect Header = Referer: http://config.privoxy.org/foo/baaz.html
210 TAG:^client-header-filter\{hide-tor-exit-notation\}$
212 #######################################################
213 # Test crunch-client-header{}.
214 #######################################################
216 {+crunch-client-header{text/html}}
217 # Set Header = Content-Type: text/html
218 # Expect Header = REMOVAL
220 # Set Header = Content-Type: text/html; charset=4711
221 # Expect Header = REMOVAL
223 # Set Header = Content-Type: text/plain
224 # Expect Header = NO CHANGE
225 TAG:^crunch-client-header\{text/plain\}$
227 #######################################################
228 # Test crunch-if-none-match.
229 #######################################################
231 {+crunch-if-none-match -hide-if-modified-since}
232 # Set Header = If-None-Match: 8987afd239d2093kd2309kd
233 # Expect Header = REMOVAL
235 # Set Header = If-None-Match: 82c3cb50c984ef11b1fed749949b2a16
236 # Expect Header = REMOVAL
238 # Set Header = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
239 # Expect Header = NO CHANGE
240 TAG:^crunch-if-none-match$
242 #######################################################
243 # Test hide-if-modified-since
244 #######################################################
246 {+hide-if-modified-since{block} -crunch-if-none-match}
247 # Set Header = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
248 # Expect Header = REMOVAL
250 # Set Header = If-None-Match: 82c3cb50c984ef11b1fed749949b2a16
251 # Expect Header = NO CHANGE
252 TAG:^hide-if-modified-since\{block\}$
254 {+hide-if-modified-since{-60} -crunch-if-none-match}
255 # Set Header = If-Modified-Since: Gee, this date is invalid
256 # Expect Header = REMOVAL
258 # Set Header = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
259 # Expect Header = SOME CHANGE
260 # Set Header = If-Modified-Since: Thu, 04-Oct-07 09:56:35 GMT
261 # Expect Header = SOME CHANGE
262 # Set Header = If-Modified-Since: Thursday, 04-Oct-2007 09:56:35 GMT
263 # Expect Header = SOME CHANGE
264 # Set Header = If-Modified-Since: Thu, 04-Oct-2007 09:56:35 GMT
265 # Expect Header = SOME CHANGE
266 # Set Header = If-Modified-Since: Thursday Oct 04 09:56:35 2007 GMT
267 # Expect Header = SOME CHANGE
269 # Set Header = If-Modified-Since: Thu, 1 Jan 1970 00:00:00 GMT
270 # Expect Header = SOME CHANGE
272 # Set Header = If-Modified-Since: Thu, 01-Jan-70 00:00:00 GMT
273 # Expect Header = SOME CHANGE
275 # Set Header = If-Modified-Since: Thursday, 01-Jan-1970 00:00:00 GMT
276 # Expect Header = SOME CHANGE
278 # Set Header = If-Modified-Since: Thu, 01-Jan-1970 00:00:00 GMT
279 # Expect Header = SOME CHANGE
281 # Set Header = If-Modified-Since: Thursday Jan 01 00:00:00 1970 GMT
282 # Expect Header = SOME CHANGE
285 # Set Header = If-Modified-Since: Thu, 1 Jan 123456789 00:00:00 GMT
286 # Expect Header = REMOVAL
287 # Set Header = If-Modified-Since: Thu, 01-Jan-123456789 00:00:00 GMT
288 # Expect Header = REMOVAL
289 # Set Header = If-Modified-Since: Thursday, 01-Jan-123456789 00:00:00 GMT
290 # Expect Header = REMOVAL
291 # Set Header = If-Modified-Since: Thu, 01-Jan-123456789 00:00:00 GMT
292 # Expect Header = REMOVAL
293 # Set Header = If-Modified-Since: Thursday Jan 01 00:00:00 123456789 GMT
294 # Expect Header = REMOVAL
296 # Set Header = If-Modified-Since: Mon, 1 Jan 2525 00:00:00 GMT
297 # Expect Header = SOME CHANGE
299 # Set Header = If-Modified-Since: Mon, 01-Jan-25 00:00:00 GMT
300 # Expect Header = SOME CHANGE
302 # Set Header = If-Modified-Since: Monday, 01-Jan-2525 00:00:00 GMT
303 # Expect Header = SOME CHANGE
305 # Set Header = If-Modified-Since: Mon, 01-Jan-2525 00:00:00 GMT
306 # Expect Header = SOME CHANGE
308 # Set Header = If-Modified-Since: Monday Jan 01 00:00:00 2525 GMT
309 # Expect Header = SOME CHANGE
312 # Set Header = If-Modified-Since: Thu, 1 Jan 1970 02:00:00 GMT
313 # Expect Header = SOME CHANGE
314 # Set Header = If-Modified-Since: Thu, 01-Jan-70 02:00:00 GMT
315 # Expect Header = SOME CHANGE
316 # Set Header = If-Modified-Since: Thursday, 01-Jan-1970 02:00:00 GMT
317 # Expect Header = SOME CHANGE
318 # Set Header = If-Modified-Since: Thu, 01-Jan-1970 02:00:00 GMT
319 # Expect Header = SOME CHANGE
320 # Set Header = If-Modified-Since: Thursday Jan 01 02:00:00 1970 GMT
321 # Expect Header = SOME CHANGE
322 TAG:^hide-if-modified-since\{-60\}$
324 {+hide-if-modified-since{+60} -crunch-if-none-match}
325 # Set Header = If-Modified-Since: Gee, this date is invalid
326 # Expect Header = REMOVAL
327 # Set Header = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
328 # Expect Header = SOME CHANGE
329 # Set Header = If-Modified-Since: Wed, 31 Dec 1969 23:59:59 GMT
330 # Expect Header = SOME CHANGE
331 TAG:^hide-if-modified-since\{\+60\}$
333 {+hide-if-modified-since{60} -crunch-if-none-match}
334 # Set Header = If-Modified-Since: Gee, this date is invalid
335 # Expect Header = REMOVAL
336 # Set Header = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
337 # Expect Header = SOME CHANGE
338 TAG:^hide-if-modified-since\{60\}$
340 {+hide-if-modified-since{+0} -crunch-if-none-match}
341 # Set Header = If-Modified-Since: Gee, this date is invalid
342 # Expect Header = REMOVAL
343 # Set Header = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
344 # Expect Header = NO CHANGE
345 TAG:^hide-if-modified-since\{\+0\}$
347 {+hide-if-modified-since{-0} -crunch-if-none-match}
348 # Set Header = If-Modified-Since: Gee, this date is invalid
349 # Expect Header = REMOVAL
350 # Set Header = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
351 # Expect Header = NO CHANGE
352 TAG:^hide-if-modified-since\{-0\}$
354 {+hide-if-modified-since{0} -crunch-if-none-match}
355 # Set Header = If-Modified-Since: Gee, this date is invalid
356 # Expect Header = REMOVAL
357 # Set Header = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
358 # Expect Header = NO CHANGE
359 TAG:^hide-if-modified-since\{0\}$
361 {+hide-if-modified-since{NaN} -crunch-if-none-match}
362 # Set Header = If-Modified-Since: Gee, this date is invalid
363 # Expect Header = REMOVAL
364 # Set Header = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
365 # Expect Header = NO CHANGE
366 TAG:^hide-if-modified-since\{NaN\}$
369 #######################################################
370 # Test crunch-outgoing-cookies
371 #######################################################
374 +crunch-outgoing-cookies \
375 -crunch-incoming-cookies \
376 -limit-cookie-lifetime \
377 -session-cookies-only \
378 -hide-if-modified-since \
380 # Set Header = If-Modified-Since: Gee, this date is invalid
381 # Expect Header = NO CHANGE
383 # Set Header = Cookie: PREF=ID=6cf0abd34262:TM=117335617:LM=1617:S=jZypyJ7LPiwFi1_
384 # Expect Header = REMOVAL
385 TAG:^crunch-outgoing-cookies$
387 #######################################################
388 # Test session-cookies-only
390 # XXX: pretty useless as session-cookies-only doesn't
391 # affect client headers.
392 #######################################################
395 -crunch-outgoing-cookies \
396 -crunch-incoming-cookies \
397 -limit-cookie-lifetime \
398 +session-cookies-only \
399 -hide-if-modified-since \
401 # Set Header = Cookie: NSC_gffe-iuuq-mc-wtfswfs=8efb330d3660;expires=Thu, 04-Oct-07 19:11:34 GMT;path=/
402 # Expect Header = NO CHANGE
404 # Set Header = Cookie: PREF=ID=6cf0abd34262:TM=117335617:LM=1617:S=jZypyJ7LPiwFi1_
405 # Expect Header = NO CHANGE
406 TAG:^session-cookies-only$
408 #######################################################
409 # Test change-x-forwarded-for
410 #######################################################
413 -change-x-forwarded-for \
415 # Set Header = X-Forwarded-For: 10.0.0.1
416 # Expect Header = NO CHANGE
417 TAG:^-change-x-forwarded-for$
420 +change-x-forwarded-for{block} \
422 # Set Header = X-Forwarded-For: 10.0.0.1
423 # Expect Header = REMOVAL
424 TAG:^change-x-forwarded-for\{block\}$
427 +change-x-forwarded-for{add} \
429 # Set Header = X-Forwarded-For: 10.0.0.1
430 # Expect Header = SOME CHANGE
431 TAG:^change-x-forwarded-for\{add\}$
433 #######################################################
434 # Test hide-from-header
435 #######################################################
438 +hide-from-header{block}\
440 # Set Header = From: schneewitchen@example.org
441 # Expect Header = REMOVAL
442 TAG:^hide-from-header\{block\}$
445 +hide-from-header{siebenzwerge@example.org}\
447 # Set Header = From: schneewitchen@example.org
448 # Expect Header = From: siebenzwerge@example.org
449 TAG:^hide-from-header\{siebenzwerge@example.org\}$
451 #######################################################
452 # Test prevent-compression
453 #######################################################
456 +prevent-compression\
458 # Set Header = Accept-Encoding: gzip, deflate
459 # Expect Header = REMOVAL
461 # Set Header = Accept-Encoding: gzip
462 # Expect Header = REMOVAL
464 # Set Header = Accept-Encoding: deflate
465 # Expect Header = REMOVAL
466 TAG:^prevent-compression$
468 #######################################################
469 # Test content filters which could cause problems with
471 #######################################################
474 -client-header-tagger{range-requests} \
475 +deanimate-gifs{last} \
479 # Set Header = Range: bytes=1234-5678
480 # Expect Header = REMOVAL
481 # Set Header = Range: bytes=1-5
482 # Expect Header = REMOVAL
483 # Set Header = If-Range: bytes=1234-5678
484 # Expect Header = REMOVAL
485 # Set Header = Request-Range: bytes=1234-5678
486 # Expect Header = REMOVAL
487 # Set Header = Range: foo
488 # Expect Header = REMOVAL
489 # Set Header = If-Range: foo
490 # Expect Header = REMOVAL
491 # Set Header = Request-Range: foo
492 # Expect Header = REMOVAL
493 # Set Header = Range: bytes=0-5678
494 # Expect Header = NO CHANGE
495 # Set Header = Range: bytes=0-
496 # Expect Header = NO CHANGE
497 # Set Header = If-Range: bytes=0-5678
498 # Expect Header = NO CHANGE
499 # Set Header = If-Range: bytes=0-
500 # Expect Header = NO CHANGE
501 # Set Header = Request-Range: bytes=0-5678
502 # Expect Header = NO CHANGE
503 # Set Header = Request-Range: bytes=0-
504 # Expect Header = NO CHANGE
505 TAG:^deanimate-gifs\{last\}$
508 -client-header-tagger{range-requests} \
510 +external-filter{blafasel} \
513 # Set Header = Range: bytes=1234-5678
514 # Expect Header = REMOVAL
515 # Set Header = Range: bytes=1-5
516 # Expect Header = REMOVAL
517 # Set Header = If-Range: bytes=1234-5678
518 # Expect Header = REMOVAL
519 # Set Header = Request-Range: bytes=1234-5678
520 # Expect Header = REMOVAL
521 # Set Header = Range: bytes=1-5
522 # Expect Header = REMOVAL
523 # Set Header = If-Range: bytes=1234-5678
524 # Expect Header = REMOVAL
525 # Set Header = Request-Range: bytes=1234-5678
526 # Expect Header = REMOVAL
527 # Set Header = Range: foo
528 # Expect Header = REMOVAL
529 # Set Header = If-Range: foo
530 # Expect Header = REMOVAL
531 # Set Header = Request-Range: foo
532 # Expect Header = REMOVAL
533 # Set Header = Range: bytes=0-5678
534 # Expect Header = NO CHANGE
535 # Set Header = Range: bytes=0-
536 # Expect Header = NO CHANGE
537 # Set Header = If-Range: bytes=0-5678
538 # Expect Header = NO CHANGE
539 # Set Header = If-Range: bytes=0-
540 # Expect Header = NO CHANGE
541 # Set Header = Request-Range: bytes=0-5678
542 # Expect Header = NO CHANGE
543 # Set Header = Request-Range: bytes=0-
544 # Expect Header = NO CHANGE
545 TAG:^external-filter\{blafasel\}$
548 -client-header-tagger{range-requests} \
551 +filter{banners-by-size} \
553 # Set Header = Range: bytes=1234-5678
554 # Expect Header = REMOVAL
555 # Set Header = Range: bytes=1-5
556 # Expect Header = REMOVAL
557 # Set Header = If-Range: bytes=1234-5678
558 # Expect Header = REMOVAL
559 # Set Header = Request-Range: bytes=1234-5678
560 # Expect Header = REMOVAL
561 # Set Header = Range: bytes=1-5
562 # Expect Header = REMOVAL
563 # Set Header = If-Range: bytes=1234-5678
564 # Expect Header = REMOVAL
565 # Set Header = Request-Range: bytes=1234-5678
566 # Expect Header = REMOVAL
567 # Set Header = Range: foo
568 # Expect Header = REMOVAL
569 # Set Header = If-Range: foo
570 # Expect Header = REMOVAL
571 # Set Header = Request-Range: foo
572 # Expect Header = REMOVAL
573 # Set Header = Range: bytes=0-5678
574 # Expect Header = NO CHANGE
575 # Set Header = Range: bytes=0-
576 # Expect Header = NO CHANGE
577 # Set Header = If-Range: bytes=0-5678
578 # Expect Header = NO CHANGE
579 # Set Header = If-Range: bytes=0-
580 # Expect Header = NO CHANGE
581 # Set Header = Request-Range: bytes=0-5678
582 # Expect Header = NO CHANGE
583 # Set Header = Request-Range: bytes=0-
584 # Expect Header = NO CHANGE
585 TAG:^filter\{banners-by-size\}$
588 -client-header-tagger{range-requests} \
593 # Set Header = Range: bytes=1234-5678
594 # Expect Header = NO CHANGE
595 # Set Header = If-Range: bytes=1234-5678
596 # Expect Header = NO CHANGE
597 # Set Header = Request-Range: bytes=1234-5678
598 # Expect Header = NO CHANGE
599 TAG:^no-content-filter$
602 # Set Header = Connection: keep-alive
603 # Expect Header = NO CHANGE
605 # Set Header = Connection:
606 # Expect Header = REMOVAL
608 TAG:^Connection: keep-alive$
611 # Set Header = Connection: keep-alive
612 # Expect Header = Connection: close
614 # Set Header = Connection:
615 # Expect Header = Connection: close
617 TAG:^Connection: close$
620 # Set Header = Connection: close
621 # Expect Header = NO CHANGE
623 TAG:^connection-sharing disabled$
626 # Set Header = Connection: close
627 # Expect Header = REMOVAL
629 # Set Header = Connection: keep-alive
630 # Expect Header = NO CHANGE
632 TAG:^connection-sharing enabled$
635 # XXX: Removing a header by not specifying a value is
636 # an inherited curl feature and could be viewed as a
637 # bug as far as Privoxy-Regression-Test is concerned.
640 # Expect Header = Host: p.p
644 # Set Header = Host: whatever.example.org
645 # Expect Header = NO CHANGE
646 TAG:^Host header other than the target host$
649 # Set Header = Keep-Alive: 20
650 # Expect Header = NO CHANGE
652 # Set Header = Keep-Alive: timeout=20, max=3
653 # Expect Header = NO CHANGE
655 # Set Header = Keep-Alive: blah=fasel, timeout=20, max=3
656 # Expect Header = NO CHANGE
658 # Set Header = Keep-Alive: timeuot=20, max=3
659 # Expect Header = REMOVAL
661 # Set Header = Keep-Alive: twenty seconds please
662 # Expect Header = REMOVAL
664 TAG:^Parse Keep-Alive header$
667 # Set Header = Keep-Alive: 20
668 # Expect Header = REMOVAL
670 # Set Header = Keep-Alive: timeout=20, max=3
671 # Expect Header = REMOVAL
673 # Set Header = Keep-Alive: blah=fasel, timeout=20, max=3
674 # Expect Header = REMOVAL
676 TAG:^Keep-Alive header removal$
679 # XXX: check the RFC to use a real value
680 # Set Header = proxy-connection: keep-alive
681 # Expect Header = REMOVAL
682 TAG:^Proxy-Connection removal$
685 # Set Header = Proxy-Connection: keep-alive
686 # Expect Header = REMOVAL
687 TAG:^Proxy-Connection removal$
690 # These are somewhat redundant when testing with
691 # GET requests, but I want to remember then when
692 # TRACE requests are supported.
694 # Set Header = Max-Forwards: 0
695 # Expect Header = NO CHANGE
696 # Set Header = Max-Forwards: 1
697 # Expect Header = NO CHANGE
698 # Set Header = Max-Forwards: -1
699 # Expect Header = NO CHANGE
700 # Set Header = Max-Forwards: 3
701 # Expect Header = NO CHANGE
702 TAG:^Max-Forwards header without TRACE method$
705 # Set Header = Proxy-Authorization: blafaseldieda
706 # Expect Header = REMOVAL
708 TAG:^Proxy-Authorization header removal$
711 # Set Header = Proxy-Authorization: blafaseldieda
712 # Expect Header = Proxy-Authorization: blafaseldieda
714 TAG:^Proxy-Authorization header forwarding$
716 ################################################################
718 # Fairly dumb tests for Privoxy CGI pages.
720 # These are mainly useful for checking for memory leaks
721 # with Valgrind or whether or not the user manual is installed
722 # correctly and are unlikely to actually detect any
724 # Note that if "Expect Status Code" is missing, 200 is implied.
726 ################################################################
728 # Fetch Test = http://p.p/
729 # Fetch Test = http://p.p/die
730 # Expect Status Code = 404
732 # Fetch Test = http://p.p/die
733 # Expect Status Code = 200
735 # Fetch Test = http://p.p/show-status
736 # Fetch Test = http://config.privoxy.org/show-status?file=actions&index=0
737 # Fetch Test = http://config.privoxy.org/show-status?file=filter&index=0
738 # XXX: for the invalid ones we probably shouldn't return status code 200.
739 # Fetch Test = http://config.privoxy.org/show-status?file=actions&index=100
740 # Fetch Test = http://config.privoxy.org/show-status?file=actions&index=NaN
741 # Fetch Test = http://config.privoxy.org/show-status?file=actions
742 # Fetch Test = http://config.privoxy.org/show-status?file=filter&index=100
743 # Fetch Test = http://config.privoxy.org/show-status?file=filter&index=NaN
744 # Fetch Test = http://config.privoxy.org/show-status?file=filter
745 # Fetch Test = http://config.privoxy.org/show-status?file=invalid
746 # Fetch Test = http://config.privoxy.org/show-status?file=trust
747 # Fetch Test = http://p.p/show-version
748 # Fetch Test = http://p.p/show-request
749 # Fetch Test = http://p.p/show-url-info
750 # Fetch Test = http://p.p/show-url-info?url=www.privoxy.org%2F
751 # Fetch Test = http://p.p/show-url-info?url=http:%2F%2Fwww.privoxy.org%2F
752 # Fetch Test = http://p.p/show-url-info?url=HTTp:%2F%2Fwww.privoxy.org%2F
753 # Fetch Test = http://p.p/show-url-info?url=https:%2F%2Fwww.privoxy.org%2F
754 # Fetch Test = http://p.p/show-url-info?url=HtTps:%2F%2Fwww.privoxy.org%2F
755 # Fetch Test = http://p.p/show-url-info?url=ftp:%2F%2Fwww.privoxy.org%2F
756 # Fetch Test = http://p.p/show-url-info?url=FTp:%2F%2Fwww.privoxy.org%2F
757 # Fetch Test = http://p.p/show-url-info?url=
758 # Fetch Test = http://p.p/show-url-info?url=%2F
759 # Depends on FEATURE_TOGGLE
760 # Fetch Test = http://p.p/toggle
762 # Fetch Test = http://p.p/toggle
763 # Expect Status Code = 404
765 # Fetch Test = http://p.p/edit-actions
766 # Fetch Test = http://p.p/eaa
767 # Fetch Test = http://p.p/eau
768 # Fetch Test = http://p.p/ear
769 # Fetch Test = http://p.p/eal
770 # Fetch Test = http://p.p/eafu
771 # Fetch Test = http://p.p/eas
772 # Fetch Test = http://p.p/easa
773 # Fetch Test = http://p.p/easr
774 # Fetch Test = http://p.p/eass
775 # Fetch Test = http://p.p/edit-actions-for-url
776 # Fetch Test = http://p.p/edit-actions-list
777 # Fetch Test = http://p.p/edit-actions-submit
778 # Fetch Test = http://p.p/edit-actions-url
779 # Fetch Test = http://p.p/edit-actions-url-form
780 # Fetch Test = http://p.p/edit-actions-add-url
781 # Fetch Test = http://p.p/edit-actions-add-url-form
782 # Fetch Test = http://p.p/edit-actions-remove-url
783 # Fetch Test = http://p.p/edit-actions-remove-url-form
784 # Fetch Test = http://p.p/edit-actions-section-add
785 # Fetch Test = http://p.p/edit-actions-section-remove
786 # Fetch Test = http://p.p/edit-actions-section-swap
787 # Fetch Test = http://p.p/error-favicon.ico
788 # Fetch Test = http://p.p/favicon.ico
789 # Fetch Test = http://p.p/robots.txt
790 # Fetch Test = http://p.p/send-banner
791 # Fetch Test = http://p.p/send-stylesheet
792 # Fetch Test = http://p.p/t
793 # Fetch Test = http://p.p/url-info-osd.xml
795 # Trusted CGI Request = http://p.p/edit-actions
796 # Expect Status Code = 302
797 # Level = 12 # Depends on the CGI editor being enabled
798 # Fetch Test = http://p.p/does-not-exist
799 # Expect Status Code = 404
800 # Trusted CGI Request = http://p.p/eaa
801 # Trusted CGI Request = http://p.p/eau
802 # Trusted CGI Request = http://p.p/ear
803 # Trusted CGI Request = http://p.p/eal
804 # Trusted CGI Request = http://p.p/eafu
805 # Trusted CGI Request = http://p.p/eas
806 # Trusted CGI Request = http://p.p/easa
807 # Trusted CGI Request = http://p.p/easr
808 # Trusted CGI Request = http://p.p/eass
809 # Trusted CGI Request = http://p.p/edit-actions-for-url
810 # Trusted CGI Request = http://p.p/edit-actions-list
811 # Trusted CGI Request = http://p.p/edit-actions-submit
812 # Trusted CGI Request = http://p.p/edit-actions-url
813 # Trusted CGI Request = http://p.p/edit-actions-url-form
814 # Trusted CGI Request = http://p.p/edit-actions-add-url
815 # Trusted CGI Request = http://p.p/edit-actions-add-url-form
816 # Trusted CGI Request = http://p.p/edit-actions-remove-url
817 # Trusted CGI Request = http://p.p/edit-actions-remove-url-form
818 # Trusted CGI Request = http://p.p/edit-actions-section-add
819 # Trusted CGI Request = http://p.p/edit-actions-section-remove
820 # Trusted CGI Request = http://p.p/edit-actions-section-swap
821 # Trusted CGI Request = http://p.p/send-stylesheet
823 # The following tests depend on Privoxy being configured to deliver the user manual
825 # Fetch Test = http://p.p/user-manual
826 # Expect Status Code = 302
828 # Fetch Test = http://p.p/user-manual/
830 # Fetch Test = http://p.p/user-manual/actions-file.html
832 # Fetch Test = http://p.p/user-manual/appendix.html
834 # Fetch Test = http://p.p/user-manual/config.html
836 # Fetch Test = http://p.p/user-manual/configuration.html
838 # Fetch Test = http://p.p/user-manual/contact.html
840 # Fetch Test = http://p.p/user-manual/copyright.html
842 # Fetch Test = http://p.p/user-manual/files-in-use.jpg
844 # Fetch Test = http://p.p/user-manual/filter-file.html
846 # Fetch Test = http://p.p/user-manual/index.html
848 # Fetch Test = http://p.p/user-manual/installation.html
850 # Fetch Test = http://p.p/user-manual/introduction.html
852 # Fetch Test = http://p.p/user-manual/p_doc.css
854 # Fetch Test = http://p.p/user-manual/proxy2.jpg
856 # Fetch Test = http://p.p/user-manual/proxy_setup.jpg
858 # Fetch Test = http://p.p/user-manual/quickstart.html
860 # Fetch Test = http://p.p/user-manual/seealso.html
862 # Fetch Test = http://p.p/user-manual/startup.html
864 # Fetch Test = http://p.p/user-manual/templates.html
866 # Fetch Test = http://p.p/user-manual/whatsnew.html
870 # Method Test = OPTIONS
877 # Method Test = DELETE
878 # Method Test = OPTIONS
879 # Method Test = TRACE
880 # Method Test = CONNECT
881 # Method Test = PROPFIND
882 # Method Test = PROPPATCH
885 # Method Test = MKCOL
887 # Method Test = UNLOCK
888 # Method Test = BCOPY
889 # Method Test = BMOVE
890 # Method Test = BDELETE
891 # Method Test = BPROPFIND
892 # Method Test = BPROPPATCH
893 # Method Test = SUBSCRIBE
894 # Method Test = UNSUBSCRIBE
895 # Method Test = NOTIFY
897 # Method Test = VERSION-CONTROL
898 # Method Test = REPORT
899 # Method Test = CHECKOUT
900 # Method Test = CHECKIN
901 # Method Test = UNCHECKOUT
902 # Method Test = MKWORKSPACE
903 # Method Test = UPDATE
904 # Method Test = LABEL
905 # Method Test = MERGE
906 # Method Test = BASELINE-CONTROL
907 # Method Test = MKACTIVITY
908 # Method Test = PATCH
909 # Method Test = PRIVOXY-REGRESSION-TEST-IN-THE-HOUSE
910 # Expect Status Code = 400
912 {+block{Forbidden Port. You are not supposed to see this.}}
913 config.privoxy.org:1-/
917 config.privoxy.org:3,79-81/
920 {+forward-override{forward-socks5 127.0.0.1:12345 .}}
921 # 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
922 # Expect Status Code = 503
923 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/
925 {+forward-override{forward-socks5 127.0.0.1:12345 .}}
926 # Fetch Test = http://oh-dear-this-hostname-is-short-enough-but-there-is-no-socks5-server-listening.example
927 # Expect Status Code = 503
928 oh-dear-this-hostname-is-short-enough-but-there-is-no-socks5-server-listening.example
930 {+forward-override{forward-socks4 127.0.0.1:12345 .}}
931 # Fetch Test = http://oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4-server-listening.example
932 # Expect Status Code = 503
933 oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4-server-listening.example
935 {+forward-override{forward-socks4a 127.0.0.1:12345 .}}
936 # Fetch Test = http://oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4a-server-listening.example
937 # Expect Status Code = 503
938 oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4a-server-listening.example
940 {+forward-override{forward-socks5 127.0.0.1:-1 127.0.0.1:12345}}
941 # This one currently triggers the same error condition as the
942 # test above (socks5 server unreachable), but once Privoxy
943 # starts to properly reject invalid ports it should become useful.
945 # Fetch Test = http://invalid-forward5-gateway-port.example
946 # Expect Status Code = 503
947 invalid-forward5-gateway-port.example
949 {+forward-override{forward-socks5 :12345 127.0.0.1:12345}}
950 # Fetch Test = http://forward5-null-gateway-host.example
951 # Expect Status Code = 503
952 forward5-null-gateway-host.example
954 {+limit-connect{443}}
955 # Fetch Test = http://www.forbidden-connect.example:444/
957 # Expect Status Code = 403
958 www.forbidden-connect.example/
960 {+block{This request failed to make it to the target destination which means the test succeeded.}}
961 # Fetch Test = http://www.blocked-request.example/blocked-request
962 # Expect Status Code = 403
963 www.blocked-request.example/blocked-request
966 # Fetch Test = http://www.blocked-request.example/blocked-request-with-no-reason-specified
967 # Expect Status Code = 403
968 www.blocked-request.example/blocked-request-with-no-reason-specified
970 # Some domain pattern tests
972 {+block{domain pattern test}}
973 # Blocked URL = http://domain-pattern-test.example/
974 # Blocked URL = http://domain-pattern-test.example.org/
975 domain-pattern-test.example.
977 {+block{Hostname patterns without trailing dots cover hostnames with trailing dots as well.}}
978 # Blocked URL = http://trailing-dot.example.org./
979 # Blocked URL = http://trailing-dot.example.org./foo
980 trailing-dot.example.org
983 # Just in case there is no white-space fuzzer in the house ...
985 # Set Header = X-LWS-Test: no superfluous white space here
986 # Expect Header = NO CHANGE
987 # Set Header = X-LWS-Test: superfluous white space in the house
988 # Expect Header = X-LWS-Test: superfluous white space in the house
989 # Set Header = X-LWS-Test : superfluous white space in the house
990 # Expect Header = X-LWS-Test: superfluous white space in the house
991 # Set Header = X-LWS-Test: :superfluous white space in the house
992 # Expect Header = X-LWS-Test: :superfluous white space in the house
993 # Set Header = X-LWS-Test: :no superfluous white space here
994 # Expect Header = NO CHANGE
995 # Set Header = X-LWS-Test: superfluous white tabs in the house
996 # Expect Header = X-LWS-Test: superfluous white tabs in the house
997 # Set Header = X-LWS-Test : superfluous white tabs in the house
998 # Expect Header = X-LWS-Test: superfluous white tabs in the house
999 # Set Header = X-LWS-Test: "leave quoted lws alone"
1000 # Expect Header = X-LWS-Test: "leave quoted lws alone"
1001 # Set Header = X-LWS-Test: "leave quoted lws alone" thxbye
1002 # Expect Header = X-LWS-Test: "leave quoted lws alone" thxbye
1003 # Set Header = X-LWS-Test: " Do I Look like quoted text? Me thinks not.
1004 # Expect Header = X-LWS-Test: " Do I Look like quoted text? Me thinks not.
1005 # Set Header = X-LWS-Test: "This is quoted" this is not "but this is again"
1006 # Expect Header = X-LWS-Test: "This is quoted" this is not "but this is again"
1007 # Set Header = X-LWS-Test: "This is quoted" this is not "this is " but " this again is not
1008 # Expect Header = X-LWS-Test: "This is quoted" this is not "this is " but " this again is not
1011 {+fast-redirects{check-decoded-url}}
1012 # Redirected URL = http://redirect.example.net/blafasel&url=http://redirected1.example.net/
1013 # Redirect Destination = http://redirected1.example.net/
1014 # Redirected URL = http://redirect.example.net/blafasel&url=http%3A%2F%2Fredirected2.example.net%2F¶meter=not-part-of-the-redirected-url
1015 # Redirect Destination = http://redirected2.example.net/
1016 # Redirected URL = http://redirect.example.net/blafasel&url=http%3A%2F%2Fredirected3.example.net%2F¶meter=not-part-of-the-redirected-url
1017 # Redirect Destination = http://redirected3.example.net/
1018 # Redirected URL = http://redirect.example.net/blafasel&url=http%3A%2F%2Fredirected4.example.net%2F%26parameter=part-of-the-redirected-url
1019 # Redirect Destination = http://redirected4.example.net/¶meter=part-of-the-redirected-url
1020 # 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
1021 # Redirect Destination = http://redirected5.example.net/¶meter2=part-of-the-redirected-url2
1022 # 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
1023 # Redirect Destination = http://redirected6.example.net/¶meter2=part-of-the-redirected-url2
1024 # 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
1025 # Redirect Destination = http://redirected7.example.net/¶meter1=part-of-the-redirected-url1
1026 # 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
1027 # Redirect Destination = http://redirected8.example.net/¶meter1=part-of-the-redirected-url1
1028 # 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
1029 # Redirect Destination = http://redirected8.example.net/¶meter1=part-of-the-redirected-url1
1030 # 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
1031 # Redirect Destination = http://redirected8.example.net/¶meter1=part-of-the-redirected-url1
1032 # 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
1033 # Redirect Destination = http://redirected8.example.net/¶meter1=part-of-the-redirected-url1
1034 redirect.example.net/
1035 # Redirected URL = http://redirect.example.net/blafaselhttp://redirect1.example.net/http://redirect2.example.net/
1036 # Redirect Destination = http://redirect2.example.net/
1037 # Redirected URL = http://redirect.example.net/blafasel%3A%2F%2Fredirect1.example.net/http://redirect2.example.net/
1038 # Redirect Destination = http://redirect2.example.net/
1039 # Redirected URL = http://redirect.example.net/blafaselhttp://redirect1.example.net/http%3A%2F%2Fredirect2.example.net/
1040 # Redirect Destination = http://redirect2.example.net/
1041 # These tests verify that Privoxy behaves as intended,
1042 # given that the encoded redirect URLs are invalid,
1043 # there are no correct redirect URLs.
1044 # Redirected URL = http://redirect.example.net/%%%%%%%%%%%%%%%%%%%%%%blafaselhttp://redirect1.example.net/http%3A%2F%2Fredirect2.example.net/%%%%%%%%%%%%%%
1045 # Redirect Destination = http://redirect2.example.net/%%%%%%%%%%%%%%
1046 # 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%%
1047 # Redirect Destination = http://redirect2.example.net/%1%2%%3%4%5%6%7%8%9%0%0%%
1049 {+fast-redirects{simple-check}}
1050 # Redirected URL = http://redirect2.example.net/blafasel?x=http://redirected.example.net/¶meter1=part-of-the-redirected-url1¶meter2=part-of-the-redirected-url1
1051 # Redirect Destination = http://redirected.example.net/¶meter1=part-of-the-redirected-url1¶meter2=part-of-the-redirected-url1
1052 redirect2.example.net/