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