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