Remove bogus comment hashes in the client-header-order section
[privoxy.git] / regression-tests.action
1 #############################################################################
2 # $Id: regression-tests.action,v 1.47 2012/11/11 12:40:53 fabiankeil Exp $
3 #############################################################################
4 #
5 # This is a configuration file for Privoxy-Regression-Test
6 # (included in the source tarball's tools directory).
7 #
8 # After referencing it in your Privoxy configuration both Privoxy and
9 # Privoxy-Regression-Test should be good to go.
10 #
11 #############################################################################
12 #
13 # Copyright (c) 2007-2012 Fabian Keil <fk@fabiankeil.de>
14 #
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.
18 #
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.
26 #
27 #############################################################################
28
29 {{settings}}
30 for-privoxy-version=3.0.20
31
32 # Some dependencies Privoxy-Regression-Test should know about:
33 #
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
48 #######################################################
49 # Enable taggers to activate the tests on demand
50 # and suppress hiding the User-Agent for
51 # Privoxy-Regression-Test to save log space.
52 #######################################################
53 {\
54  +client-header-tagger{user-agent} \
55  +client-header-tagger{privoxy-control} \
56  +client-header-filter{privoxy-control} \
57 }
58 config.privoxy.org/
59 p.p/
60 127.0.0.1/
61
62 {-hide-user-agent}
63 TAG:^User-Agent: Privoxy-Regression-Test
64
65 #######################################################
66 # Test accept-language{}.
67 #######################################################
68
69 {+hide-accept-language{en-gb}}
70 # Set Header    = Accept-Language: de-de
71 # Expect Header = Accept-Language: en-gb
72 TAG:^hide-accept-language\{en-gb\}$
73
74 {+hide-accept-language{block}}
75 # Set Header    = Accept-Language: de-de
76 # Expect Header = REMOVAL
77 TAG:^hide-accept-language\{block\}$
78
79 #######################################################
80 # Sections for hide-referrer{} to test:
81 #
82 # 1) conditional-block
83 # 2) conditional-forge
84 # 3) forge
85 # 4) block
86 # 5) a parameter that looks like a valid fake referrer
87 # 6) a parameter that looks like an invalid fake referrer
88 #######################################################
89
90 {+hide-referrer{conditional-block}}
91 # Set Header    = Referer: http://www.example.org/foo
92 # Expect Header = REMOVAL
93 #
94 # Set Header    = Referer: http://p.p/foo
95 # Expect Header = NO CHANGE
96 #
97 # Set Header    = Referer: p.p/
98 # Expect Header = REMOVAL
99 #
100 # Set Header    = Referer: p
101 # Expect Header = REMOVAL
102 #
103 # Set Header    = Referer: http://
104 # Expect Header = REMOVAL
105 #
106 # Set Header    = Referer: https://p.p/
107 # Expect Header = REMOVAL
108 TAG:^hide-referrer\{conditional-block\}$
109
110 {+hide-referrer{conditional-forge}}
111 # Set Header    = Referer: http://www.example.org/foo
112 # Expect Header = Referer: http://p.p/
113 #
114 # Set Header    = Referer: http://p.p/foo
115 # Expect Header = NO CHANGE
116 #
117 # Set Header    = Referer: p.p/
118 # Expect Header = Referer: http://p.p/
119 #
120 # Set Header    = Referer: p
121 # Expect Header = Referer: http://p.p/
122 #
123 # Set Header    = Referer: http://
124 # Expect Header = Referer: http://p.p/
125 #
126 # Set Header    = Referer: https://p.p/
127 # Expect Header = Referer: http://p.p/
128 TAG:^hide-referrer\{conditional-forge\}$
129
130 {+hide-referrer{forge}}
131 # Set Header    = Referer: http://www.example.org/foo
132 # Expect Header = Referer: http://p.p/
133 TAG:^hide-referrer\{forge\}$
134
135 {+hide-referrer{block}}
136 # Set Header    = Referer: http://www.example.org/foo
137 # Expect Header = REMOVAL
138 TAG:^hide-referrer\{block\}$
139
140 {+hide-referrer{invalid}}
141 # Set Header    = Referer: http://www.example.org/foo
142 # Expect Header = Referer: invalid
143 TAG:^hide-referrer\{invalid\}$
144
145 {+hide-referrer{http://www.privoxy.org/}}
146 # Set Header    = Referer: http://www.example.org/asdf
147 # Expect Header = Referer: http://www.privoxy.org/
148 TAG:^hide-referrer\{http://www.privoxy.org/\}$
149
150 #{+hide-referrer{}}
151 #TAG:^hide-referrer\{\}$
152
153 #######################################################
154 # Test hide-user-agent{}.
155 #######################################################
156
157 {+hide-user-agent{Mozilla/5.0 (X11; U; FreeBSD alpha; en-GB; rv:1.8.1.6) Gecko/20070913 Firefox/2.0.0.6}}
158 # 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
159 # 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
160 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\}$
161
162 {+hide-user-agent{block}}
163 # XXX: Check the code that is tested here.
164 # Set Header = ua-blah: blah
165 # Expect Header = REMOVAL
166 TAG:^hide-user-agent{block}$
167
168 {-hide-user-agent{}}
169 # Set Header = ua-blah: blah
170 # Expect Header = NO CHANGE
171 TAG:^-hide-user-agent{block}$
172
173
174 #######################################################
175 # Test add-header{}.
176 #######################################################
177
178 {+add-header{X-Custom-Header: yes, please}}
179 # Set Header    = X-Whatever: foo
180 # Expect Header = X-Custom-Header: yes, please
181 TAG:^add-header\{X-Custom-Header: yes, please\}$
182
183 #######################################################
184 # Test client-header-filter{hide-tor-exit-notation}.
185 #######################################################
186
187 {+client-header-filter{hide-tor-exit-notation} -hide-referer}
188 # Set Header    = Referer: http://p.p.zwiebelsuppe.exit/
189 # Expect Header = Referer: http://p.p/
190 #
191 # Set Header    = Referer: http://p.p.zwiebelsuppe.exit/foo/bar/baaz/
192 # Expect Header = Referer: http://p.p/foo/bar/baaz/
193 #
194 # Set Header    = Referer: http://p.p/
195 # Expect Header = NO CHANGE
196 #
197 # Set Header    = Referer: http://config.privoxy.org.zwiebelsuppe.exit/foo/bar/baaz.html
198 # Expect Header = Referer: http://config.privoxy.org/foo/bar/baaz.html
199 #
200 # Set Header    = Host: p.p.zwiebelsuppe.exit
201 # Expect Header = Host: p.p
202 #
203 # Set Header    = Host: p.p
204 # Expect Header = NO CHANGE
205 #
206 # Set Header    = Referer: http://config.privoxy.org.ad356ef8e87a89e6c898b74500d58607ac691178.exit/foo/baaz.html
207 # Expect Header = Referer: http://config.privoxy.org/foo/baaz.html
208 TAG:^client-header-filter\{hide-tor-exit-notation\}$
209
210 #######################################################
211 # Test crunch-client-header{}.
212 #######################################################
213
214 {+crunch-client-header{text/html}}
215 # Set Header    = Content-Type: text/html
216 # Expect Header = REMOVAL
217 #
218 # Set Header    = Content-Type: text/html; charset=4711
219 # Expect Header = REMOVAL
220 #
221 # Set Header    = Content-Type: text/plain
222 # Expect Header = NO CHANGE
223 TAG:^crunch-client-header\{text/plain\}$
224
225 #######################################################
226 # Test crunch-if-none-match.
227 #######################################################
228
229 {+crunch-if-none-match -hide-if-modified-since}
230 # Set Header    = If-None-Match: 8987afd239d2093kd2309kd
231 # Expect Header = REMOVAL
232 #
233 # Set Header    = If-None-Match: 82c3cb50c984ef11b1fed749949b2a16
234 # Expect Header = REMOVAL
235 #
236 # Set Header    = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
237 # Expect Header = NO CHANGE
238 TAG:^crunch-if-none-match$
239
240 #######################################################
241 # Test hide-if-modified-since
242 #######################################################
243
244 {+hide-if-modified-since{block} -crunch-if-none-match}
245 # Set Header    = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
246 # Expect Header = REMOVAL
247 #
248 # Set Header    = If-None-Match: 82c3cb50c984ef11b1fed749949b2a16
249 # Expect Header = NO CHANGE
250 TAG:^hide-if-modified-since\{block\}$
251
252 {+hide-if-modified-since{-60} -crunch-if-none-match}
253 # Set Header    = If-Modified-Since: Gee, this date is invalid
254 # Expect Header = REMOVAL
255 #
256 # Set Header    = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
257 # Expect Header = SOME CHANGE
258 # Set Header    = If-Modified-Since: Thu, 04-Oct-07 09:56:35 GMT
259 # Expect Header = SOME CHANGE
260 # Set Header    = If-Modified-Since: Thursday, 04-Oct-2007 09:56:35 GMT
261 # Expect Header = SOME CHANGE
262 # Set Header    = If-Modified-Since: Thu, 04-Oct-2007 09:56:35 GMT
263 # Expect Header = SOME CHANGE
264 # Set Header    = If-Modified-Since: Thursday Oct 04 09:56:35 2007 GMT
265 # Expect Header = SOME CHANGE
266 #
267 # Set Header    = If-Modified-Since: Thu, 1 Jan 1970 00:00:00 GMT
268 # Expect Header = SOME CHANGE
269 # Level = 17
270 # Set Header    = If-Modified-Since: Thu, 01-Jan-70 00:00:00 GMT
271 # Expect Header = SOME CHANGE
272 # Level = 17
273 # Set Header    = If-Modified-Since: Thursday, 01-Jan-1970 00:00:00 GMT
274 # Expect Header = SOME CHANGE
275 # Level = 17
276 # Set Header    = If-Modified-Since: Thu, 01-Jan-1970 00:00:00 GMT
277 # Expect Header = SOME CHANGE
278 # Level = 17
279 # Set Header    = If-Modified-Since: Thursday Jan 01 00:00:00 1970 GMT
280 # Expect Header = SOME CHANGE
281 # Level = 17
282 #
283 # Set Header    = If-Modified-Since: Thu, 1 Jan 123456789 00:00:00 GMT
284 # Expect Header = REMOVAL
285 # Set Header    = If-Modified-Since: Thu, 01-Jan-123456789 00:00:00 GMT
286 # Expect Header = REMOVAL
287 # Set Header    = If-Modified-Since: Thursday, 01-Jan-123456789 00:00:00 GMT
288 # Expect Header = REMOVAL
289 # Set Header    = If-Modified-Since: Thu, 01-Jan-123456789 00:00:00 GMT
290 # Expect Header = REMOVAL
291 # Set Header    = If-Modified-Since: Thursday Jan 01 00:00:00 123456789 GMT
292 # Expect Header = REMOVAL
293 #
294 # Set Header    = If-Modified-Since: Mon, 1 Jan 2525 00:00:00 GMT
295 # Expect Header = SOME CHANGE
296 # Level = 17
297 # Set Header    = If-Modified-Since: Mon, 01-Jan-25 00:00:00 GMT
298 # Expect Header = SOME CHANGE
299 # Level = 17
300 # Set Header    = If-Modified-Since: Monday, 01-Jan-2525 00:00:00 GMT
301 # Expect Header = SOME CHANGE
302 # Level = 17
303 # Set Header    = If-Modified-Since: Mon, 01-Jan-2525 00:00:00 GMT
304 # Expect Header = SOME CHANGE
305 # Level = 17
306 # Set Header    = If-Modified-Since: Monday Jan 01 00:00:00 2525 GMT
307 # Expect Header = SOME CHANGE
308 # Level = 17
309 #
310 # Set Header    = If-Modified-Since: Thu, 1 Jan 1970 02:00:00 GMT
311 # Expect Header = SOME CHANGE
312 # Set Header    = If-Modified-Since: Thu, 01-Jan-70 02:00:00 GMT
313 # Expect Header = SOME CHANGE
314 # Set Header    = If-Modified-Since: Thursday, 01-Jan-1970 02:00:00 GMT
315 # Expect Header = SOME CHANGE
316 # Set Header    = If-Modified-Since: Thu, 01-Jan-1970 02:00:00 GMT
317 # Expect Header = SOME CHANGE
318 # Set Header    = If-Modified-Since: Thursday Jan 01 02:00:00 1970 GMT
319 # Expect Header = SOME CHANGE
320 TAG:^hide-if-modified-since\{-60\}$
321
322 {+hide-if-modified-since{+60} -crunch-if-none-match}
323 # Set Header    = If-Modified-Since: Gee, this date is invalid
324 # Expect Header = REMOVAL
325 # Set Header    = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
326 # Expect Header = SOME CHANGE
327 # Set Header    = If-Modified-Since: Wed, 31 Dec 1969 23:59:59 GMT
328 # Expect Header = SOME CHANGE
329 TAG:^hide-if-modified-since\{\+60\}$
330
331 {+hide-if-modified-since{60} -crunch-if-none-match}
332 # Set Header    = If-Modified-Since: Gee, this date is invalid
333 # Expect Header = REMOVAL
334 # Set Header    = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
335 # Expect Header = SOME CHANGE
336 TAG:^hide-if-modified-since\{60\}$
337
338 {+hide-if-modified-since{+0} -crunch-if-none-match}
339 # Set Header    = If-Modified-Since: Gee, this date is invalid
340 # Expect Header = REMOVAL
341 # Set Header    = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
342 # Expect Header = NO CHANGE
343 TAG:^hide-if-modified-since\{\+0\}$
344
345 {+hide-if-modified-since{-0} -crunch-if-none-match}
346 # Set Header    = If-Modified-Since: Gee, this date is invalid
347 # Expect Header = REMOVAL
348 # Set Header    = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
349 # Expect Header = NO CHANGE
350 TAG:^hide-if-modified-since\{-0\}$
351
352 {+hide-if-modified-since{0} -crunch-if-none-match}
353 # Set Header    = If-Modified-Since: Gee, this date is invalid
354 # Expect Header = REMOVAL
355 # Set Header    = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
356 # Expect Header = NO CHANGE
357 TAG:^hide-if-modified-since\{0\}$
358
359 {+hide-if-modified-since{NaN} -crunch-if-none-match}
360 # Set Header    = If-Modified-Since: Gee, this date is invalid
361 # Expect Header = REMOVAL
362 # Set Header    = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
363 # Expect Header = NO CHANGE
364 TAG:^hide-if-modified-since\{NaN\}$
365
366
367 #######################################################
368 # Test crunch-outgoing-cookies
369 #######################################################
370
371 {\
372  +crunch-outgoing-cookies \
373  -crunch-incoming-cookies \
374  -limit-cookie-lifetime   \
375  -session-cookies-only    \
376  -hide-if-modified-since  \
377 }
378 # Set Header    = If-Modified-Since: Gee, this date is invalid
379 # Expect Header = NO CHANGE
380 #
381 # Set Header    = Cookie: PREF=ID=6cf0abd34262:TM=117335617:LM=1617:S=jZypyJ7LPiwFi1_
382 # Expect Header = REMOVAL
383 TAG:^crunch-outgoing-cookies$
384
385 #######################################################
386 # Test session-cookies-only
387 #
388 # XXX: pretty useless as session-cookies-only doesn't
389 # affect client headers.
390 #######################################################
391
392 {\
393  -crunch-outgoing-cookies \
394  -crunch-incoming-cookies \
395  -limit-cookie-lifetime   \
396  +session-cookies-only    \
397  -hide-if-modified-since  \
398 }
399 # Set Header    = Cookie: NSC_gffe-iuuq-mc-wtfswfs=8efb330d3660;expires=Thu, 04-Oct-07 19:11:34 GMT;path=/
400 # Expect Header = NO CHANGE
401 #
402 # Set Header    = Cookie: PREF=ID=6cf0abd34262:TM=117335617:LM=1617:S=jZypyJ7LPiwFi1_
403 # Expect Header = NO CHANGE
404 TAG:^session-cookies-only$
405
406 #######################################################
407 # Test change-x-forwarded-for
408 #######################################################
409
410 {\
411  -change-x-forwarded-for \
412 }
413 # Set Header    = X-Forwarded-For: 10.0.0.1
414 # Expect Header = NO CHANGE
415 TAG:^-change-x-forwarded-for$
416
417 {\
418  +change-x-forwarded-for{block} \
419 }
420 # Set Header    = X-Forwarded-For: 10.0.0.1
421 # Expect Header = REMOVAL
422 TAG:^change-x-forwarded-for\{block\}$
423
424 {\
425  +change-x-forwarded-for{add} \
426 }
427 # Set Header    = X-Forwarded-For: 10.0.0.1
428 # Expect Header = SOME CHANGE
429 TAG:^change-x-forwarded-for\{add\}$
430
431 #######################################################
432 # Test hide-from-header
433 #######################################################
434
435 {\
436  +hide-from-header{block}\
437 }
438 # Set Header    = From: schneewitchen@example.org
439 # Expect Header = REMOVAL
440 TAG:^hide-from-header\{block\}$
441
442 {\
443  +hide-from-header{siebenzwerge@example.org}\
444 }
445 # Set Header    = From: schneewitchen@example.org
446 # Expect Header = From: siebenzwerge@example.org
447 TAG:^hide-from-header\{siebenzwerge@example.org\}$
448
449 #######################################################
450 # Test prevent-compression
451 #######################################################
452
453 {\
454  +prevent-compression\
455 }
456 # Set Header    = Accept-Encoding: gzip, deflate
457 # Expect Header = REMOVAL
458 #
459 # Set Header    = Accept-Encoding: gzip
460 # Expect Header = REMOVAL
461 #
462 # Set Header    = Accept-Encoding: deflate
463 # Expect Header = REMOVAL
464 TAG:^prevent-compression$
465
466 #######################################################
467 # Test content filters which could cause problems with
468 # range requests.
469 #######################################################
470
471 {\
472  -client-header-tagger{range-requests} \
473  +deanimate-gifs{last} \
474  -filter \
475 }
476 # Set Header    = Range: bytes=1234-5678
477 # Expect Header = REMOVAL
478 # Set Header    = Range: bytes=1-5
479 # Expect Header = REMOVAL
480 # Set Header    = If-Range: bytes=1234-5678
481 # Expect Header = REMOVAL
482 # Set Header    = Request-Range: bytes=1234-5678
483 # Expect Header = REMOVAL
484 # Set Header    = Range: foo
485 # Expect Header = REMOVAL
486 # Set Header    = If-Range: foo
487 # Expect Header = REMOVAL
488 # Set Header    = Request-Range: foo
489 # Expect Header = REMOVAL
490 # Set Header    = Range: bytes=0-5678
491 # Expect Header = NO CHANGE
492 # Set Header    = Range: bytes=0-
493 # Expect Header = NO CHANGE
494 # Set Header    = If-Range: bytes=0-5678
495 # Expect Header = NO CHANGE
496 # Set Header    = If-Range: bytes=0-
497 # Expect Header = NO CHANGE
498 # Set Header    = Request-Range: bytes=0-5678
499 # Expect Header = NO CHANGE
500 # Set Header    = Request-Range: bytes=0-
501 # Expect Header = NO CHANGE
502 TAG:^deanimate-gifs\{last\}$
503
504 {\
505  -client-header-tagger{range-requests} \
506  -deanimate-gifs \
507  +filter{banners-by-size} \
508 }
509 # Set Header    = Range: bytes=1234-5678
510 # Expect Header = REMOVAL
511 # Set Header    = Range: bytes=1-5
512 # Expect Header = REMOVAL
513 # Set Header    = If-Range: bytes=1234-5678
514 # Expect Header = REMOVAL
515 # Set Header    = Request-Range: bytes=1234-5678
516 # Expect Header = REMOVAL
517 # Set Header    = Range: bytes=1-5
518 # Expect Header = REMOVAL
519 # Set Header    = If-Range: bytes=1234-5678
520 # Expect Header = REMOVAL
521 # Set Header    = Request-Range: bytes=1234-5678
522 # Expect Header = REMOVAL
523 # Set Header    = Range: foo
524 # Expect Header = REMOVAL
525 # Set Header    = If-Range: foo
526 # Expect Header = REMOVAL
527 # Set Header    = Request-Range: foo
528 # Expect Header = REMOVAL
529 # Set Header    = Range: bytes=0-5678
530 # Expect Header = NO CHANGE
531 # Set Header    = Range: bytes=0-
532 # Expect Header = NO CHANGE
533 # Set Header    = If-Range: bytes=0-5678
534 # Expect Header = NO CHANGE
535 # Set Header    = If-Range: bytes=0-
536 # Expect Header = NO CHANGE
537 # Set Header    = Request-Range: bytes=0-5678
538 # Expect Header = NO CHANGE
539 # Set Header    = Request-Range: bytes=0-
540 # Expect Header = NO CHANGE
541 TAG:^filter\{banners-by-size\}$
542
543 {\
544  -client-header-tagger{range-requests} \
545  -deanimate-gifs \
546  -filter \
547 }
548 # Set Header    = Range: bytes=1234-5678
549 # Expect Header = NO CHANGE
550 # Set Header    = If-Range: bytes=1234-5678
551 # Expect Header = NO CHANGE
552 # Set Header    = Request-Range: bytes=1234-5678
553 # Expect Header = NO CHANGE
554 TAG:^no-content-filter$
555
556 {}
557 # Set Header    = Connection: keep-alive
558 # Expect Header = NO CHANGE
559 # Level = 13
560 # Set Header    = Connection:
561 # Expect Header = REMOVAL
562 # Level = 13
563 TAG:^Connection: keep-alive$
564
565 {}
566 # Set Header    = Connection: keep-alive
567 # Expect Header = Connection: close
568 # Level = 14
569 # Set Header    = Connection:
570 # Expect Header = Connection: close
571 # Level = 14
572 TAG:^Connection: close$
573
574 {}
575 # Set Header    = Connection: close
576 # Expect Header = NO CHANGE
577 # Level = 15
578 TAG:^connection-sharing disabled$
579
580 {}
581 # Set Header    = Connection: close
582 # Expect Header = REMOVAL
583 # Level = 16
584 # Set Header    = Connection: keep-alive
585 # Expect Header = NO CHANGE
586 # Level = 16
587 TAG:^connection-sharing enabled$
588
589 {}
590 # XXX: Removing a header by not specifying a value is
591 # an inherited curl feature and could be viewed as a
592 # bug as far as Privoxy-Regression-Test is concerned.
593 #
594 # Set Header    = Host:
595 # Expect Header = Host: p.p
596 TAG:^No Host header$
597
598 {}
599 # Set Header    = Host: whatever.example.org
600 # Expect Header = NO CHANGE
601 TAG:^Host header other than the target host$
602
603 {}
604 # Set Header = Keep-Alive: 20
605 # Expect Header = NO CHANGE
606 # Level = 13
607 TAG:^Pass Keep-Alive header$
608
609 {}
610 # Set Header = Keep-Alive: 20
611 # Expect Header = REMOVAL
612 # Level = 14
613 TAG:^Keep-Alive header removal$
614
615 {}
616 # XXX: check the RFC to use a real value
617 # Set Header = proxy-connection: keep-alive
618 # Expect Header = REMOVAL
619 TAG:^Proxy-Connection removal$
620
621 {}
622 # Set Header = Proxy-Connection: keep-alive
623 # Expect Header = REMOVAL
624 TAG:^Proxy-Connection removal$
625
626 {}
627 # These are somewhat redundant when testing with
628 # GET requests, but I want to remember then when
629 # TRACE requests are supported.
630 #
631 # Set Header = Max-Forwards: 0
632 # Expect Header = NO CHANGE
633 # Set Header = Max-Forwards: 1
634 # Expect Header = NO CHANGE
635 # Set Header = Max-Forwards: -1
636 # Expect Header = NO CHANGE
637 # Set Header = Max-Forwards: 3
638 # Expect Header = NO CHANGE
639 TAG:^Max-Forwards header without TRACE method$
640
641 ################################################################
642 #
643 # Fairly dumb tests for Privoxy CGI pages.
644 #
645 # These are mainly useful for checking for memory leaks
646 # with Valgrind or whether or not the user manual is installed
647 # correctly and are unlikely to actually detect any
648 #
649 # Note that if "Expect Status Code" is missing, 200 is implied.
650 #
651 ################################################################
652
653 # Fetch Test = http://p.p/
654 # Fetch Test = http://p.p/die
655 # Expect Status Code = 404
656 # Level = 18
657 # Fetch Test = http://p.p/die
658 # Expect Status Code = 200
659 # Level = 19
660 # Fetch Test = http://p.p/show-status
661 # Fetch Test = http://config.privoxy.org/show-status?file=actions&index=0
662 # Fetch Test = http://config.privoxy.org/show-status?file=filter&index=0
663 # XXX: for the invalid ones we probably shouldn't return status code 200.
664 # Fetch Test = http://config.privoxy.org/show-status?file=actions&index=100
665 # Fetch Test = http://config.privoxy.org/show-status?file=actions&index=NaN
666 # Fetch Test = http://config.privoxy.org/show-status?file=actions
667 # Fetch Test = http://config.privoxy.org/show-status?file=filter&index=100
668 # Fetch Test = http://config.privoxy.org/show-status?file=filter&index=NaN
669 # Fetch Test = http://config.privoxy.org/show-status?file=filter
670 # Fetch Test = http://config.privoxy.org/show-status?file=invalid
671 # Fetch Test = http://config.privoxy.org/show-status?file=trust
672 # Fetch Test = http://p.p/show-version
673 # Fetch Test = http://p.p/show-request
674 # Fetch Test = http://p.p/show-url-info
675 # Fetch Test = http://p.p/show-url-info?url=www.privoxy.org%2F
676 # Fetch Test = http://p.p/show-url-info?url=http:%2F%2Fwww.privoxy.org%2F
677 # Fetch Test = http://p.p/show-url-info?url=HTTp:%2F%2Fwww.privoxy.org%2F
678 # Fetch Test = http://p.p/show-url-info?url=https:%2F%2Fwww.privoxy.org%2F
679 # Fetch Test = http://p.p/show-url-info?url=HtTps:%2F%2Fwww.privoxy.org%2F
680 # Fetch Test = http://p.p/show-url-info?url=ftp:%2F%2Fwww.privoxy.org%2F
681 # Fetch Test = http://p.p/show-url-info?url=FTp:%2F%2Fwww.privoxy.org%2F
682 # Fetch Test = http://p.p/show-url-info?url=
683 # Fetch Test = http://p.p/show-url-info?url=%2F
684 # Depends on FEATURE_TOGGLE
685 # Fetch Test = http://p.p/toggle
686 # Level = 20
687 # Fetch Test = http://p.p/toggle
688 # Expect Status Code = 404
689 # Level = 21
690 # Fetch Test = http://p.p/edit-actions
691 # Fetch Test = http://p.p/eaa
692 # Fetch Test = http://p.p/eau
693 # Fetch Test = http://p.p/ear
694 # Fetch Test = http://p.p/eal
695 # Fetch Test = http://p.p/eafu
696 # Fetch Test = http://p.p/eas
697 # Fetch Test = http://p.p/easa
698 # Fetch Test = http://p.p/easr
699 # Fetch Test = http://p.p/eass
700 # Fetch Test = http://p.p/edit-actions-for-url
701 # Fetch Test = http://p.p/edit-actions-list
702 # Fetch Test = http://p.p/edit-actions-submit
703 # Fetch Test = http://p.p/edit-actions-url
704 # Fetch Test = http://p.p/edit-actions-url-form
705 # Fetch Test = http://p.p/edit-actions-add-url
706 # Fetch Test = http://p.p/edit-actions-add-url-form
707 # Fetch Test = http://p.p/edit-actions-remove-url
708 # Fetch Test = http://p.p/edit-actions-remove-url-form
709 # Fetch Test = http://p.p/edit-actions-section-add
710 # Fetch Test = http://p.p/edit-actions-section-remove
711 # Fetch Test = http://p.p/edit-actions-section-swap
712 # Fetch Test = http://p.p/error-favicon.ico
713 # Fetch Test = http://p.p/favicon.ico
714 # Fetch Test = http://p.p/robots.txt
715 # Fetch Test = http://p.p/send-banner
716 # Fetch Test = http://p.p/send-stylesheet
717 # Fetch Test = http://p.p/t
718 # Fetch Test = http://p.p/url-info-osd.xml
719
720 # Trusted CGI Request = http://p.p/edit-actions
721 # Expect Status Code = 302
722 # Level = 12 # Depends on the CGI editor being enabled
723 # Fetch Test = http://p.p/does-not-exist
724 # Expect Status Code = 404
725 # Trusted CGI Request = http://p.p/eaa
726 # Trusted CGI Request = http://p.p/eau
727 # Trusted CGI Request = http://p.p/ear
728 # Trusted CGI Request = http://p.p/eal
729 # Trusted CGI Request = http://p.p/eafu
730 # Trusted CGI Request = http://p.p/eas
731 # Trusted CGI Request = http://p.p/easa
732 # Trusted CGI Request = http://p.p/easr
733 # Trusted CGI Request = http://p.p/eass
734 # Trusted CGI Request = http://p.p/edit-actions-for-url
735 # Trusted CGI Request = http://p.p/edit-actions-list
736 # Trusted CGI Request = http://p.p/edit-actions-submit
737 # Trusted CGI Request = http://p.p/edit-actions-url
738 # Trusted CGI Request = http://p.p/edit-actions-url-form
739 # Trusted CGI Request = http://p.p/edit-actions-add-url
740 # Trusted CGI Request = http://p.p/edit-actions-add-url-form
741 # Trusted CGI Request = http://p.p/edit-actions-remove-url
742 # Trusted CGI Request = http://p.p/edit-actions-remove-url-form
743 # Trusted CGI Request = http://p.p/edit-actions-section-add
744 # Trusted CGI Request = http://p.p/edit-actions-section-remove
745 # Trusted CGI Request = http://p.p/edit-actions-section-swap
746 # Trusted CGI Request = http://p.p/send-stylesheet
747
748 # The following tests depend on Privoxy being configured to deliver the user manual
749
750 # Fetch Test = http://p.p/user-manual
751 # Expect Status Code = 302
752 # Level = 9
753 # Fetch Test = http://p.p/user-manual/
754 # Level = 9
755 # Fetch Test = http://p.p/user-manual/actions-file.html
756 # Level = 9
757 # Fetch Test = http://p.p/user-manual/appendix.html
758 # Level = 9
759 # Fetch Test = http://p.p/user-manual/config.html
760 # Level = 9
761 # Fetch Test = http://p.p/user-manual/configuration.html
762 # Level = 9
763 # Fetch Test = http://p.p/user-manual/contact.html
764 # Level = 9
765 # Fetch Test = http://p.p/user-manual/copyright.html
766 # Level = 9
767 # Fetch Test = http://p.p/user-manual/files-in-use.jpg
768 # Level = 9
769 # Fetch Test = http://p.p/user-manual/filter-file.html
770 # Level = 9
771 # Fetch Test = http://p.p/user-manual/index.html
772 # Level = 9
773 # Fetch Test = http://p.p/user-manual/installation.html
774 # Level = 9
775 # Fetch Test = http://p.p/user-manual/introduction.html
776 # Level = 9
777 # Fetch Test = http://p.p/user-manual/p_doc.css
778 # Level = 9
779 # Fetch Test = http://p.p/user-manual/proxy2.jpg
780 # Level = 9
781 # Fetch Test = http://p.p/user-manual/proxy_setup.jpg
782 # Level = 9
783 # Fetch Test = http://p.p/user-manual/quickstart.html
784 # Level = 9
785 # Fetch Test = http://p.p/user-manual/seealso.html
786 # Level = 9
787 # Fetch Test = http://p.p/user-manual/startup.html
788 # Level = 9
789 # Fetch Test = http://p.p/user-manual/templates.html
790 # Level = 9
791 # Fetch Test = http://p.p/user-manual/whatsnew.html
792 # Level = 9
793
794
795 # Method Test = OPTIONS
796 # Method Test = GET
797 # Method Test = get
798 # Method Test = gEt
799 # Method Test = HEAD
800 # Method Test = POST
801 # Method Test = PUT
802 # Method Test = DELETE
803 # Method Test = OPTIONS
804 # Method Test = TRACE
805 # Method Test = CONNECT
806 # Method Test = PROPFIND
807 # Method Test = PROPPATCH
808 # Method Test = MOVE
809 # Method Test = COPY
810 # Method Test = MKCOL
811 # Method Test = LOCK
812 # Method Test = UNLOCK
813 # Method Test = BCOPY
814 # Method Test = BMOVE
815 # Method Test = BDELETE
816 # Method Test = BPROPFIND
817 # Method Test = BPROPPATCH
818 # Method Test = SUBSCRIBE
819 # Method Test = UNSUBSCRIBE
820 # Method Test = NOTIFY
821 # Method Test = POLL
822 # Method Test = VERSION-CONTROL
823 # Method Test = REPORT
824 # Method Test = CHECKOUT
825 # Method Test = CHECKIN
826 # Method Test = UNCHECKOUT
827 # Method Test = MKWORKSPACE
828 # Method Test = UPDATE
829 # Method Test = LABEL
830 # Method Test = MERGE
831 # Method Test = BASELINE-CONTROL
832 # Method Test = MKACTIVITY
833 # Method Test = PRIVOXY-REGRESSION-TEST-IN-THE-HOUSE
834 # Expect Status Code = 400
835
836 {+block{Forbidden Port. You are not supposed to see this.}}
837 config.privoxy.org:1-/
838 p.p:1-/
839
840 {-block}
841 config.privoxy.org:3,79-81/
842 p.p:3,22,79-81/
843
844 {+forward-override{forward-socks5 127.0.0.1:12345 .}}
845 # 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
846 # Expect Status Code = 503
847 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/
848
849 {+forward-override{forward-socks5 127.0.0.1:12345 .}}
850 # Fetch Test = http://oh-dear-this-hostname-is-short-enough-but-there-is-no-socks5-server-listening.example
851 # Expect Status Code = 503
852 oh-dear-this-hostname-is-short-enough-but-there-is-no-socks5-server-listening.example
853
854 {+forward-override{forward-socks4 127.0.0.1:12345 .}}
855 # Fetch Test = http://oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4-server-listening.example
856 # Expect Status Code = 503
857 oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4-server-listening.example
858
859 {+forward-override{forward-socks4a 127.0.0.1:12345 .}}
860 # Fetch Test = http://oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4a-server-listening.example
861 # Expect Status Code = 503
862 oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4a-server-listening.example
863
864 {+forward-override{forward-socks5 127.0.0.1:-1 127.0.0.1:12345}}
865 # This one currently triggers the same error condition as the
866 # test above (socks5 server unreachable), but once Privoxy
867 # starts to properly reject invalid ports it should become useful.
868 #
869 # Fetch Test = http://invalid-forward5-gateway-port.example
870 # Expect Status Code = 503
871 invalid-forward5-gateway-port.example
872
873 {+forward-override{forward-socks5 :12345 127.0.0.1:12345}}
874 # Fetch Test = http://forward5-null-gateway-host.example
875 # Expect Status Code = 503
876 forward5-null-gateway-host.example
877
878 {+limit-connect{443}}
879 # Fetch Test = http://www.forbidden-connect.example:444/
880 # Method = CONNECT
881 # Expect Status Code = 403
882 www.forbidden-connect.example/
883
884 {+block{This request failed to make it to the target destination which means the test succeeded.}}
885 # Fetch Test = http://www.blocked-request.example/blocked-request
886 # Expect Status Code = 403
887 www.blocked-request.example/blocked-request
888
889 {+block}
890 # Fetch Test = http://www.blocked-request.example/blocked-request-with-no-reason-specified
891 # Expect Status Code = 403
892 www.blocked-request.example/blocked-request-with-no-reason-specified
893
894 # Some domain pattern tests
895 #
896 {+block{domain pattern test}}
897 # Blocked URL = http://domain-pattern-test.example/
898 # Blocked URL = http://domain-pattern-test.example.org/
899 domain-pattern-test.example.
900
901 {+block{Hostname patterns without trailing dots cover hostnames with trailing dots as well.}}
902 # Blocked URL = http://trailing-dot.example.org./
903 # Blocked URL = http://trailing-dot.example.org./foo
904 trailing-dot.example.org
905
906 {}
907 # Just in case there is no white-space fuzzer in the house ...
908 #
909 # Set Header = X-LWS-Test: no superfluous white space here
910 # Expect Header = NO CHANGE
911 # Set Header = X-LWS-Test:  superfluous   white space  in  the   house
912 # Expect Header = X-LWS-Test: superfluous white space in the house
913 # Set Header = X-LWS-Test   :  superfluous   white   space   in   the    house
914 # Expect Header = X-LWS-Test: superfluous white space in the house
915 # Set Header = X-LWS-Test:  :superfluous white space in the house
916 # Expect Header = X-LWS-Test: :superfluous white space in the house
917 # Set Header = X-LWS-Test: :no superfluous white space here
918 # Expect Header = NO CHANGE
919 # Set Header = X-LWS-Test:      superfluous             white                   tabs in the house
920 # Expect Header = X-LWS-Test: superfluous white tabs in the house
921 # Set Header = X-LWS-Test       :       superfluous             white                   tabs in the house
922 # Expect Header = X-LWS-Test: superfluous white tabs in the house
923 # Set Header = X-LWS-Test: "leave  quoted  lws alone"
924 # Expect Header = X-LWS-Test: "leave  quoted  lws alone"
925 # Set Header = X-LWS-Test:  "leave  quoted  lws alone"  thxbye
926 # Expect Header = X-LWS-Test: "leave  quoted  lws alone" thxbye
927 # Set Header = X-LWS-Test: " Do I Look like     quoted  text? Me    thinks  not.
928 # Expect Header = X-LWS-Test: " Do I Look like quoted text? Me thinks not.
929 # Set Header = X-LWS-Test: "This  is  quoted" this  is  not "but   this  is  again"
930 # Expect Header = X-LWS-Test: "This  is  quoted" this is not "but   this  is  again"
931 # Set Header = X-LWS-Test:  "This  is  quoted" this   is  not "this  is  "  but  "  this again   is  not
932 # Expect Header = X-LWS-Test: "This  is  quoted" this is not "this  is  " but " this again is not
933 TAG:^LWS Tests$
934
935 {+fast-redirects{check-decoded-url}}
936 # Redirected URL = http://redirect.example.net/blafasel&url=http://redirected1.example.net/
937 # Redirect Destination = http://redirected1.example.net/
938 # Redirected URL = http://redirect.example.net/blafasel&url=http%3A%2F%2Fredirected2.example.net%2F&parameter=not-part-of-the-redirected-url
939 # Redirect Destination = http://redirected2.example.net/
940 # Redirected URL = http://redirect.example.net/blafasel&url=http%3A%2F%2Fredirected3.example.net%2F&parameter=not-part-of-the-redirected-url
941 # Redirect Destination = http://redirected3.example.net/
942 # Redirected URL = http://redirect.example.net/blafasel&url=http%3A%2F%2Fredirected4.example.net%2F%26parameter=part-of-the-redirected-url
943 # Redirect Destination = http://redirected4.example.net/&parameter=part-of-the-redirected-url
944 # 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
945 # Redirect Destination = http://redirected5.example.net/&parameter2=part-of-the-redirected-url2
946 # 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&parameter3=not-part-of-the-redirected-url2
947 # Redirect Destination = http://redirected6.example.net/&parameter2=part-of-the-redirected-url2
948 # Redirected URL = http://redirect.example.net/blafasel?x=http%3A%2F%2Fredirected7.example.net%2F%26parameter1=part-of-the-redirected-url1&parameter2=not-part-of-the-redirected-url1
949 # Redirect Destination = http://redirected7.example.net/&parameter1=part-of-the-redirected-url1
950 # Redirected URL = http://redirect.example.net/blafasel?x=http%3A%2F%2Fredirected8.example.net%2F%26parameter1=part-of-the-redirected-url1&parameter2=not-part-of-the-redirected-url1&parameter3=not-part-of-the-redirected-url1
951 # Redirect Destination = http://redirected8.example.net/&parameter1=part-of-the-redirected-url1
952 # 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&parameter2=not-part-of-the-redirected-url1&parameter3=not-part-of-the-redirected-url1
953 # Redirect Destination = http://redirected8.example.net/&parameter1=part-of-the-redirected-url1
954 # Redirected URL = http://redirect.example.net/blafasel???????????????????????????????=http%3A%2F%2Fredirected8.example.net%2F%26parameter1=part-of-the-redirected-url1&parameter2=not-part-of-the-redirected-url1&parameter3=not-part-of-the-redirected-url1
955 # Redirect Destination = http://redirected8.example.net/&parameter1=part-of-the-redirected-url1
956 # Redirected URL = http://redirect.example.net/blafasel&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&=http%3A%2F%2Fredirected8.example.net%2F%26parameter1=part-of-the-redirected-url1&parameter2=not-part-of-the-redirected-url1&parameter3=not-part-of-the-redirected-url1
957 # Redirect Destination = http://redirected8.example.net/&parameter1=part-of-the-redirected-url1
958 redirect.example.net/
959 # Redirected URL = http://redirect.example.net/blafaselhttp://redirect1.example.net/http://redirect2.example.net/
960 # Redirect Destination = http://redirect2.example.net/
961 # Redirected URL = http://redirect.example.net/blafasel%3A%2F%2Fredirect1.example.net/http://redirect2.example.net/
962 # Redirect Destination = http://redirect2.example.net/
963 # Redirected URL = http://redirect.example.net/blafaselhttp://redirect1.example.net/http%3A%2F%2Fredirect2.example.net/
964 # Redirect Destination = http://redirect2.example.net/
965 # These tests verify that Privoxy behaves as intended,
966 # given that the encoded redirect URLs are invalid,
967 # there are no correct redirect URLs.
968 # Redirected URL = http://redirect.example.net/%%%%%%%%%%%%%%%%%%%%%%blafaselhttp://redirect1.example.net/http%3A%2F%2Fredirect2.example.net/%%%%%%%%%%%%%%
969 # Redirect Destination = http://redirect2.example.net/%%%%%%%%%%%%%%
970 # 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%%
971 # Redirect Destination = http://redirect2.example.net/%1%2%%3%4%5%6%7%8%9%0%0%%
972
973 {+fast-redirects{simple-check}}
974 # Redirected URL = http://redirect2.example.net/blafasel?x=http://redirected.example.net/&parameter1=part-of-the-redirected-url1&parameter2=part-of-the-redirected-url1
975 # Redirect Destination = http://redirected.example.net/&parameter1=part-of-the-redirected-url1&parameter2=part-of-the-redirected-url1
976 redirect2.example.net/