Lines Matching refs:t

15 my $t;
21 $t->{REQUEST} = ( <<EOF
25 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
26 ok($tf->handle_http($t) == 0, 'Valid HTTP/1.0 Request') or ($tf->stop_proc, die());
28 $t->{REQUEST} = ( <<EOF
32 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
33 ok($tf->handle_http($t) == 0, 'OPTIONS');
35 $t->{REQUEST} = ( <<EOF
41 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ];
42 ok($tf->handle_http($t) == 0, 'OPTIONS');
44 $t->{REQUEST} = ( <<EOF
48 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
49 ok($tf->handle_http($t) == 0, 'URL-encoding, %00');
51 $t->{REQUEST} = ( <<EOF
57 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 413 } ];
58 ok($tf->handle_http($t) == 0, 'Content-Length > max-request-size');
60 $t->{REQUEST} = ( <<EOF
64 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Content-Type' => 'image/…
65 ok($tf->handle_http($t) == 0, 'Content-Type - image/jpeg');
67 $t->{REQUEST} = ( <<EOF
71 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Content-Type' => 'image/…
72 ok($tf->handle_http($t) == 0, 'Content-Type - image/jpeg (upper case)');
74 $t->{REQUEST} = ( <<EOF
78 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
79 ok($tf->handle_http($t) == 0, 'uppercase filenames');
81 $t->{REQUEST} = ( <<EOF
85 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ];
86 ok($tf->handle_http($t) == 0, 'file not found + querystring');
88 $t->{REQUEST} = ( <<EOF
93 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '12345'…
94 ok($tf->handle_http($t) == 0, 'GET, content == 12345, mimetype text/plain');
96 $t->{REQUEST} = ( <<EOF
101 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '12345'…
102 ok($tf->handle_http($t) == 0, 'GET, content == 12345, mimetype text/html');
105 $t->{REQUEST} = ( <<EOF
111 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
112 ok($tf->handle_http($t) == 0, 'POST request, empty request-body');
114 $t->{REQUEST} = ( <<EOF
118 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '-HTTP-Content' => ''} ];
119 ok($tf->handle_http($t) == 0, 'HEAD request, no content');
121 $t->{REQUEST} = ( <<EOF
126 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '-HTTP-Content' => '', 'C…
127 ok($tf->handle_http($t) == 0, 'HEAD request, mimetype text/html, content-length');
129 $t->{REQUEST} = ( <<EOF
134 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200, '-HTTP-Content' => '', 'C…
135 ok($tf->handle_http($t) == 0, 'Hostname in first line, HTTP/1.1');
137 $t->{REQUEST} = ( <<EOF
141 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '-HTTP-Content' => '', 'C…
142 ok($tf->handle_http($t) == 0, 'Hostname in first line as https url');
144 $t->{REQUEST} = ( <<EOF
148 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, '-HTTP-Content' => '' } ];
149 ok($tf->handle_http($t) == 0, 'HEAD request, file-not-found, query-string');
153 $t->{REQUEST} = ( <<EOF
164 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ];
165 ok($tf->handle_http($t) == 0, 'Continue, Expect');
169 $t->{REQUEST} = ( <<EOF
182 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ];
183 ok($tf->handle_http($t) == 0, 'POST via Transfer-Encoding: chunked, lc hex');
185 $t->{REQUEST} = ( <<EOF
198 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ];
199 ok($tf->handle_http($t) == 0, 'POST via Transfer-Encoding: chunked, uc hex');
201 $t->{REQUEST} = ( <<EOF
214 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ];
215 ok($tf->handle_http($t) == 0, 'POST via Transfer-Encoding: chunked, two hex');
217 $t->{REQUEST} = ( <<EOF
231 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ];
232 ok($tf->handle_http($t) == 0, 'POST via Transfer-Encoding: chunked, with trailer');
234 $t->{REQUEST} = ( <<EOF
247 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ];
248 ok($tf->handle_http($t) == 0, 'POST via Transfer-Encoding: chunked, chunked header comment');
250 $t->{REQUEST} = ( <<EOF
263 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 400 } ];
264 ok($tf->handle_http($t) == 0, 'POST via Transfer-Encoding: chunked; bad chunked header');
266 $t->{REQUEST} = ( <<EOF
279 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 400 } ];
280 ok($tf->handle_http($t) == 0, 'POST via Transfer-Encoding: chunked; mismatch chunked header size an…
282 $t->{REQUEST} = ( <<EOF
295 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 400 } ];
296 ok($tf->handle_http($t) == 0, 'POST via Transfer-Encoding: chunked; chunked header too long');
300 $t->{REQUEST} = ( <<EOF
307 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 206, 'HTTP-Content' => '1234' …
308 ok($tf->handle_http($t) == 0, 'GET, Range 0-3');
310 $t->{REQUEST} = ( <<EOF
317 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 206, 'HTTP-Content' => '45'."\…
318 ok($tf->handle_http($t) == 0, 'GET, Range -3');
320 $t->{REQUEST} = ( <<EOF
327 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 206, 'HTTP-Content' => '45'."\…
328 ok($tf->handle_http($t) == 0, 'GET, Range 3-');
330 $t->{REQUEST} = ( <<EOF
337 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 206, 'HTTP-Content' => '12345'…
338 ok($tf->handle_http($t) == 0, 'GET, Range 0-1,3-4 (ranges merged)');
340 $t->{REQUEST} = ( <<EOF
347 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 206, 'HTTP-Content' => <<EOF
361 ok($tf->handle_http($t) == 0, 'GET, Range 0-1,97-98 (ranges not merged)');
363 $t->{REQUEST} = ( <<EOF
370 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 206, 'Content-Range' => 'bytes…
371 ok($tf->handle_http($t) == 0, 'GET, Range 0-');
373 $t->{REQUEST} = ( <<EOF
380 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 416 } ];
381 ok($tf->handle_http($t) == 0, 'GET, Range 0--');
383 $t->{REQUEST} = ( <<EOF
390 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 416 } ];
391 ok($tf->handle_http($t) == 0, 'GET, Range -2-3');
393 $t->{REQUEST} = ( <<EOF
400 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 416, 'HTTP-Content' => <<EOF
414 ok($tf->handle_http($t) == 0, 'GET, Range -0');
416 $t->{REQUEST} = ( <<EOF
423 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 416, 'HTTP-Content' => <<EOF
438 ok($tf->handle_http($t) == 0, 'GET, Range start out of range');
441 $t->{REQUEST} = ( <<EOF
448 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ];
449 ok($tf->handle_http($t) == 0, 'GET, Range with range-requests-disabled');
451 $t->{REQUEST} = ( <<EOF
459 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200, 'HTTP-Content' => "12345\…
460 ok($tf->handle_http($t) == 0, 'GET, Range invalid range-unit (first)');
462 $t->{REQUEST} = ( <<EOF
470 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 206 } ];
471 ok($tf->handle_http($t) == 0, 'GET, Range ignore invalid range (second)');
473 $t->{REQUEST} = ( <<EOF
480 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
481 ok($tf->handle_http($t) == 0, 'OPTIONS with Content-Length');
483 $t->{REQUEST} = ( <<EOF
488 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
489 ok($tf->handle_http($t) == 0, 'OPTIONS for RTSP');
493 $t->{REQUEST} = ( <<EOF
499 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 304 } ];
500 ok($tf->handle_http($t) == 0, 'Similar Headers (bug #1287)');
502 $t->{REQUEST} = ( <<EOF
507 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 304, '-Content-Length' => '', …
508 ok($tf->handle_http($t) == 0, 'Status 304 has no Content-Length (#1002)');
510 $t->{REQUEST} = ( <<EOF
515 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '12345'…
516 $t->{SLOWREQUEST} = 1;
517 ok($tf->handle_http($t) == 0, 'GET, slow \\r\\n\\r\\n (#2105)');
518 undef $t->{SLOWREQUEST};
520 $t->{REQUEST} = ( <<EOF
524 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ];
525 ok($tf->handle_http($t) == 0, 'pathinfo on a directory');
528 $t->{REQUEST} = ( <<EOF
534 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200, 'HTTP-Content' => '12345'…
535 ok($tf->handle_http($t) == 0, 'Connection-header, leading comma');
537 $t->{REQUEST} = ( <<EOF
543 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200, 'HTTP-Content' => '12345'…
544 ok($tf->handle_http($t) == 0, 'Connection-header, no value between two commas');
546 $t->{REQUEST} = ( <<EOF
552 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200, 'HTTP-Content' => '12345'…
553 ok($tf->handle_http($t) == 0, 'Connection-header, space between two commas');
555 $t->{REQUEST} = ( <<EOF
561 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200, 'HTTP-Content' => '12345'…
562 ok($tf->handle_http($t) == 0, 'Connection-header, comma after value');
564 $t->{REQUEST} = ( <<EOF
570 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200, 'HTTP-Content' => '12345'…
571 ok($tf->handle_http($t) == 0, 'Connection-header, comma and space after value');
576 $t->{REQUEST} = ( <<EOF
582 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200, '+Date' => '' } ];
583 ok($tf->handle_http($t) == 0, 'Date header');
589 $t->{REQUEST} = ( <<EOF
594 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Content-Length' => '6' }…
595 ok($tf->handle_http($t) == 0, 'Content-Length for text/html');
597 $t->{REQUEST} = ( <<EOF
602 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Content-Length' => '6' }…
603 ok($tf->handle_http($t) == 0, 'Content-Length for text/plain');
608 $t->{REQUEST} = ( <<EOF
612 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => '/dummydir/…
613 ok($tf->handle_http($t) == 0, 'internal redirect in directory');
615 $t->{REQUEST} = ( <<EOF
619 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => '/dummydir/…
620 ok($tf->handle_http($t) == 0, 'internal redirect in directory + querystring');
622 $t->{REQUEST} = ( <<EOF
626 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => '/~test%20%…
627 ok($tf->handle_http($t) == 0, 'internal redirect in directory with special characters');
629 $t->{REQUEST} = ( <<EOF
633 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => '/~test%20%…
634 ok($tf->handle_http($t) == 0, 'internal redirect in directory with special characters + querystring…
639 $t->{REQUEST} = ( <<EOF
644 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Content-Length' => '6' }…
645 ok($tf->handle_http($t) == 0, 'disabling simple-vhost via conditionals');
647 $t->{REQUEST} = ( <<EOF
652 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ];
653 ok($tf->handle_http($t) == 0, 'simple-vhost via conditionals');
658 $t->{REQUEST} = ( <<EOF
668 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } , { 'HTTP-Protocol' => '…
669 ok($tf->handle_http($t) == 0, 'Explicit HTTP/1.0 Keep-Alive');
670 undef $t->{RESPONSE};
672 $t->{REQUEST} = ( <<EOF
682 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } , { 'HTTP-Protocol' => '…
683 ok($tf->handle_http($t) == 0, 'Explicit HTTP/1.0 Keep-Alive');
684 undef $t->{RESPONSE};
686 $t->{REQUEST} = ( <<EOF
695 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } , { 'HTTP-Protocol' => '…
696 ok($tf->handle_http($t) == 0, 'Implicit HTTP/1.0 Keep-Alive');
698 $t->{REQUEST} = ( <<EOF
708 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } , { 'HTTP-Protocol' => '…
709 ok($tf->handle_http($t) == 0, 'Explicit HTTP/1.1 Keep-Alive');
711 $t->{REQUEST} = ( <<EOF
720 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } , { 'HTTP-Protocol' => '…
721 ok($tf->handle_http($t) == 0, 'Implicit HTTP/1.1 Keep-Alive');
723 $t->{REQUEST} = ( <<EOF
733 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } , { 'HTTP-Protocol' => '…
734 ok($tf->handle_http($t) == 0, 'Implicit HTTP/1.1 Keep-Alive w/ extra blank b/w requests');
736 $t->{REQUEST} = ( <<EOF
747 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } , { 'HTTP-Protocol' => '…
748 ok($tf->handle_http($t) == 0, 'Implicit HTTP/1.1 Keep-Alive w/ excess blank b/w requests');
753 $t->{REQUEST} = ( <<EOF
758 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "static…
759 ok($tf->handle_http($t) == 0, '404 handler => static');
761 $t->{REQUEST} = ( <<EOF
766 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "found …
767 ok($tf->handle_http($t) == 0, '404 handler => dynamic(200)');
769 $t->{REQUEST} = ( <<EOF
774 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 302, 'Location' => "http://www…
775 ok($tf->handle_http($t) == 0, '404 handler => dynamic(302)');
777 $t->{REQUEST} = ( <<EOF
782 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'HTTP-Content' => "Not fo…
783 ok($tf->handle_http($t) == 0, '404 handler => dynamic(404)');
785 $t->{REQUEST} = ( <<EOF
790 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'HTTP-Content' => "REDIRE…
791 ok($tf->handle_http($t) == 0, 'error handler => dynamic(REDIRECT_STATUS)');
793 $t->{REQUEST} = ( <<EOF
798 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "found …
799 ok($tf->handle_http($t) == 0, '404 handler => dynamic(nostatus)');
801 $t->{REQUEST} = ( <<EOF
806 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'HTTP-Content' => "send40…
807 ok($tf->handle_http($t) == 0, '404 generated by CGI should stay 404');
812 $t->{REQUEST} = ( <<EOF
817 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ];
818 ok($tf->handle_http($t) == 0, 'condition: Referer - no referer');
820 $t->{REQUEST} = ( <<EOF
826 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ];
827 ok($tf->handle_http($t) == 0, 'condition: Referer - referer matches regex');
829 $t->{REQUEST} = ( <<EOF
834 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
835 ok($tf->handle_http($t) == 0, 'condition: Referer - no referer');
837 $t->{REQUEST} = ( <<EOF
843 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
844 ok($tf->handle_http($t) == 0, 'condition: Referer - referer matches regex');
846 $t->{REQUEST} = ( <<EOF
852 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
853 ok($tf->handle_http($t) == 0, 'condition: Referer - referer doesn\'t match');
855 $t->{REQUEST} = ( <<EOF
864 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 403 }, { 'HTTP-Protocol' => '…
865 ok($tf->handle_http($t) == 0, 'remote ip cache (#255)');
867 $t->{REQUEST} = ( <<EOF
872 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
873 ok($tf->handle_http($t) == 0, 'condition: $HTTP["referer"] == "" and Referer is no set');
875 $t->{REQUEST} = ( <<EOF
881 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
882 ok($tf->handle_http($t) == 0, 'condition: $HTTP["referer"] == "" and Referer is empty');
884 $t->{REQUEST} = ( <<EOF
890 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ];
891 ok($tf->handle_http($t) == 0, 'condition: $HTTP["referer"] == "" and Referer: foobar');
898 $t->{REQUEST} = ( <<EOF
903 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
904 ok($tf->handle_http($t) == 0, 'uppercase access');
906 $t->{REQUEST} = ( <<EOF
911 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
912 ok($tf->handle_http($t) == 0, 'lowercase access');
916 $t->{REQUEST} = ( <<EOF
921 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401 } ];
922 ok($tf->handle_http($t) == 0, 'uppercase access');
924 $t->{REQUEST} = ( <<EOF
929 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401 } ];
930 ok($tf->handle_http($t) == 0, 'lowercase access');
934 $t->{REQUEST} = ( <<EOF
939 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
940 ok($tf->handle_http($t) == 0, 'upper case access to staticfile.exclude-extension');
942 $t->{REQUEST} = ( <<EOF
947 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
948 ok($tf->handle_http($t) == 0, 'lowercase access');
952 $t->{REQUEST} = ( <<EOF
957 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
958 ok($tf->handle_http($t) == 0, 'uppercase access to url.access-deny protected location');
960 $t->{REQUEST} = ( <<EOF
965 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
966 ok($tf->handle_http($t) == 0, 'lowercase access');
995 $t->{REQUEST} = ( <<EOF
1000 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
1001 ok($tf->handle_http($t) == 0, 'allow: simple file');
1004 $t->{REQUEST} = ( <<EOF
1009 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
1010 ok($tf->handle_http($t) == 0, 'allow: symlinked file');
1013 $t->{REQUEST} = ( <<EOF
1018 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
1019 ok($tf->handle_http($t) == 0, 'allow: directly symlinked dir');
1022 $t->{REQUEST} = ( <<EOF
1027 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
1028 ok($tf->handle_http($t) == 0, 'allow: symlinked dir in path');
1032 $t->{REQUEST} = ( <<EOF
1037 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
1038 ok($tf->handle_http($t) == 0, 'deny: simple file');
1041 $t->{REQUEST} = ( <<EOF
1046 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
1047 ok($tf->handle_http($t) == 0, 'deny: symlinked file');
1050 $t->{REQUEST} = ( <<EOF
1055 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
1056 ok($tf->handle_http($t) == 0, 'deny: directly symlinked dir');
1059 $t->{REQUEST} = ( <<EOF
1064 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
1065 ok($tf->handle_http($t) == 0, 'deny: symlinked dir in path');
1072 $t->{REQUEST} = ( <<EOF
1077 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401 } ];
1078 ok($tf->handle_http($t) == 0, 'Missing Auth-token');
1080 $t->{REQUEST} = ( <<EOF
1086 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
1087 ok($tf->handle_http($t) == 0, 'Basic-Auth: Invalid base64 Auth-token');
1089 $t->{REQUEST} = ( <<EOF
1095 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401 } ];
1096 ok($tf->handle_http($t) == 0, 'Basic-Auth: Wrong Auth-token');
1098 $t->{REQUEST} = ( <<EOF
1104 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
1105 ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - plain');
1109 $t->{REQUEST} = ( <<EOF
1115 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
1116 ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - htpasswd (des)');
1118 $t->{REQUEST} = ( <<EOF
1124 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
1125 ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - htpasswd (des) (lowercase)');
1128 $t->{REQUEST} = ( <<EOF
1134 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
1135 ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - htpasswd (sha)');
1137 $t->{REQUEST} = ( <<EOF
1143 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401 } ];
1144 ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - htpasswd (sha, wrong password)');
1146 $t->{REQUEST} = ( <<EOF
1152 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
1153 ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - htpasswd (apr-md5)');
1155 $t->{REQUEST} = ( <<EOF
1161 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401 } ];
1162 ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - htpasswd (apr-md5, wrong password)');
1168 $t->{REQUEST} = ( <<EOF
1174 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
1175 ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - htpasswd (crypt-md5)');
1178 $t->{REQUEST} = ( <<EOF
1184 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401 } ];
1185 ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token');
1188 $t->{REQUEST} = ( <<EOF
1196 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401 } ];
1197 ok($tf->handle_http($t) == 0, 'Digest-Auth: missing qop, no crash');
1203 $t->{REQUEST} = ( <<EOF
1214 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
1215 ok($tf->handle_http($t) == 0, 'Digest-Auth: missing nc (noncecount instead), no crash');
1217 $t->{REQUEST} = ( <<EOF
1223 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
1224 ok($tf->handle_http($t) == 0, 'Basic-Auth: Invalid Base64');
1226 $t->{REQUEST} = ( <<EOF
1235 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
1236 ok($tf->handle_http($t) == 0, 'Digest-Auth: md5-sess + missing cnonce');
1238 $t->{REQUEST} = ( <<EOF
1247 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401, 'WWW-Authenticate' => '/,…
1248 ok($tf->handle_http($t) == 0, 'Digest-Auth: stale nonce');
1250 $t->{REQUEST} = ( <<EOF
1259 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401, 'WWW-Authenticate' => '/,…
1260 ok($tf->handle_http($t) == 0, 'Digest-Auth: BWS, trailing WS, stale nonce');
1265 $t->{REQUEST} = ( <<EOF
1269 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
1270 ok($tf->handle_http($t) == 0, 'perl via cgi');
1273 $t->{REQUEST} = ( <<EOF
1277 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ];
1278 ok($tf->handle_http($t) == 0, 'No source retrieval');
1283 $t->{REQUEST} = ( <<EOF
1287 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/cgi.p…
1288 ok($tf->handle_http($t) == 0, 'perl via cgi + pathinfo');
1290 $t->{REQUEST} = ( <<EOF
1294 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
1295 ok($tf->handle_http($t) == 0, 'perl via cgi and internal redirect from CGI');
1297 $t->{REQUEST} = ( <<EOF
1302 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Content-Length' => 4348 …
1303 ok($tf->handle_http($t) == 0, 'X-Sendfile');
1305 $t->{REQUEST} = ( <<EOF
1310 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 302, 'Location' => 'http://www…
1311 ok($tf->handle_http($t) == 0, 'Status + Location via FastCGI');
1313 $t->{REQUEST} = ( <<EOF
1318 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 302, 'Location' => 'http://www…
1319 ok($tf->handle_http($t) == 0, 'Trailing slash as path-info (#1989: workaround broken operating syst…
1321 $t->{REQUEST} = ( <<EOF
1325 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 502 } ];
1326 ok($tf->handle_http($t) == 0, 'NPH + perl, invalid status-code (#14)');
1328 $t->{REQUEST} = ( <<EOF
1332 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 304 } ];
1333 ok($tf->handle_http($t) == 0, 'NPH + perl, setting status-code (#1125)');
1335 $t->{REQUEST} = ( <<EOF
1339 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
1340 ok($tf->handle_http($t) == 0, 'NPH + perl, setting status-code');
1342 $t->{REQUEST} = ( <<EOF
1346 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'CGI/1.…
1347 ok($tf->handle_http($t) == 0, 'cgi-env: GATEWAY_INTERFACE');
1349 $t->{REQUEST} = ( <<EOF
1353 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'query_…
1354 ok($tf->handle_http($t) == 0, 'cgi-env: QUERY_STRING');
1356 $t->{REQUEST} = ( <<EOF
1360 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/cgi.p…
1361 ok($tf->handle_http($t) == 0, 'cgi-env: SCRIPT_NAME');
1363 $t->{REQUEST} = ( <<EOF
1367 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/cgi.p…
1368 ok($tf->handle_http($t) == 0, 'cgi-env: SCRIPT_NAME w/ PATH_INFO');
1370 $t->{REQUEST} = ( <<EOF
1374 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/path/…
1375 ok($tf->handle_http($t) == 0, 'cgi-env: PATH_INFO');
1377 $t->{REQUEST} = ( <<EOF
1382 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'foo' }…
1383 ok($tf->handle_http($t) == 0, 'cgi-env: quoting headers with numbers');
1385 $t->{REQUEST} = ( <<EOF
1390 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'www.ex…
1391 ok($tf->handle_http($t) == 0, 'cgi-env: HTTP_HOST');
1393 $t->{REQUEST} = ( <<EOF
1399 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200, '+Content-Length' => '' }…
1400 ok($tf->handle_http($t) == 0, 'cgi-env: HTTP_HOST');
1402 $t->{REQUEST} = ( <<EOF
1408 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200, 'HTTP-Content' => '[ABSEN…
1409 ok($tf->handle_http($t) == 0, 'cgi-env: ABSENT');
1411 $t->{REQUEST} = ( <<EOF
1417 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200, 'HTTP-Content' => '' } ];
1418 ok($tf->handle_http($t) == 0, 'cgi-env: BLANK_VALUE');
1421 $t->{REQUEST} = ( <<EOF
1425 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 302, 'Location' => 'http://www…
1426 ok($tf->handle_http($t) == 0, 'broken header via perl cgi');
1431 $t->{REQUEST} = ( <<EOF
1437 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '' } ];
1438 ok($tf->handle_http($t) == 0, 'Vary is set');
1440 $t->{REQUEST} = ( <<EOF
1446 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-L…
1447 ok($tf->handle_http($t) == 0, 'deflate - Content-Length and Content-Encoding is set');
1449 $t->{REQUEST} = ( <<EOF
1455 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-L…
1456 ok($tf->handle_http($t) == 0, 'deflate - Content-Length and Content-Encoding is set');
1458 $t->{REQUEST} = ( <<EOF
1464 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-L…
1465 ok($tf->handle_http($t) == 0, 'gzip - Content-Length and Content-Encoding is set');
1467 $t->{REQUEST} = ( <<EOF
1473 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-L…
1474 ok($tf->handle_http($t) == 0, 'gzip - Content-Length and Content-Encoding is set');
1477 $t->{REQUEST} = ( <<EOF
1483 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', '+Content-…
1484 ok($tf->handle_http($t) == 0, 'gzip, deflate - Content-Length and Content-Encoding is set');
1486 $t->{REQUEST} = ( <<EOF
1492 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', '+Content-…
1493 ok($tf->handle_http($t) == 0, 'Content-Type is from the original file');
1495 $t->{REQUEST} = ( <<EOF
1504 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '-Content-Encoding' => ''…
1505 ok($tf->handle_http($t) == 0, 'Empty Accept-Encoding');
1507 $t->{REQUEST} = ( <<EOF
1513 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-E…
1514 ok($tf->handle_http($t) == 0, 'bzip2 requested but disabled');
1519 $t->{REQUEST} = ( <<EOF
1525 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '127.0.…
1526 ok($tf->handle_http($t) == 0, 'expect 127.0.10.1, from single ip');
1528 $t->{REQUEST} = ( <<EOF
1534 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '127.0.…
1535 ok($tf->handle_http($t) == 0, 'expect 127.0.20.1, from two ips');
1537 $t->{REQUEST} = ( <<EOF
1543 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '127.0.…
1544 ok($tf->handle_http($t) == 0, 'expect 127.0.20.1, from chained proxies');
1546 $t->{REQUEST} = ( <<EOF
1552 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '127.0.…
1553 ok($tf->handle_http($t) == 0, 'expect 127.0.20.1, from chained proxies');
1566 $t->{REQUEST} = ( <<EOF
1571 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
1572 ok($tf_proxy->handle_http($t) == 0, 'valid request');
1574 $t->{REQUEST} = ( <<EOF
1579 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Server' => 'lighttpd-1.4…
1580 ok($tf_proxy->handle_http($t) == 0, 'drop Server from real server');
1582 $t->{REQUEST} = ( <<EOF
1587 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/some+…
1588 ok($tf_proxy->handle_http($t) == 0, 'rewrited urls work with encoded path');
1597 $t->{REQUEST} = ( <<EOF
1602 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'trace…
1603 ok($tf->handle_http($t) == 0, 'query first setenv');
1605 $t->{REQUEST} = ( <<EOF
1610 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'seten…
1611 ok($tf->handle_http($t) == 0, 'query second setenv');
1613 $t->{REQUEST} = ( <<EOF
1618 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'newen…
1619 ok($tf->handle_http($t) == 0, 'query set-environment');
1621 $t->{REQUEST} = ( <<EOF
1626 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'foo' …
1627 ok($tf->handle_http($t) == 0, 'query add-request-header');
1629 $t->{REQUEST} = ( <<EOF
1634 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'foo2'…
1635 ok($tf->handle_http($t) == 0, 'query set-request-header');
1637 $t->{REQUEST} = ( <<EOF
1642 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'BAR' => 'foo' } ];
1643 ok($tf->handle_http($t) == 0, 'query add-response-header');
1645 $t->{REQUEST} = ( <<EOF
1650 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'BAR2' => 'bar2' } ];
1651 ok($tf->handle_http($t) == 0, 'query set-response-header');