Browse Source

[tests] consolidate some tests/ content

master
Glenn Strauss 6 months ago
parent
commit
5ec5e124c1
  1. 2
      configure.ac
  2. 2
      tests/core-404-handler.t
  3. 10
      tests/docroot/123/100.txt
  4. 1
      tests/docroot/123/12345.html
  5. 1
      tests/docroot/123/12345.txt
  6. 1
      tests/docroot/123/Makefile.am
  7. 1
      tests/docroot/123/dummyfile.bla
  8. 2
      tests/docroot/Makefile.am
  9. 8
      tests/docroot/www/Makefile.am
  10. 7
      tests/docroot/www/cgi-pathinfo.pl
  11. 47
      tests/docroot/www/cgi.pl
  12. 4
      tests/docroot/www/crlfcrash.pl
  13. 1
      tests/docroot/www/expire/Makefile.am
  14. 0
      tests/docroot/www/expire/access.txt
  15. 0
      tests/docroot/www/expire/modification.txt
  16. 8
      tests/docroot/www/get-header.pl
  17. 13
      tests/docroot/www/get-post-len.pl
  18. 2
      tests/docroot/www/indexfile/Makefile.am
  19. 3
      tests/docroot/www/indexfile/query_string.pl
  20. 13
      tests/docroot/www/ip.pl
  21. 10
      tests/docroot/www/nph-status.pl
  22. 6
      tests/docroot/www/send404.pl
  23. 43
      tests/mod-cgi.t
  24. 8
      tests/mod-extforward.t
  25. 10
      tests/mod-setenv.t
  26. 26
      tests/prepare.sh
  27. 2
      tests/proxy.conf
  28. 18
      tests/request.t

2
configure.ac

@ -1651,9 +1651,7 @@ AC_CONFIG_FILES([\
doc/systemd/Makefile \
Makefile \
src/Makefile \
tests/docroot/123/Makefile \
tests/docroot/Makefile \
tests/docroot/www/expire/Makefile \
tests/docroot/www/indexfile/Makefile \
tests/docroot/www/Makefile \
tests/Makefile \

2
tests/core-404-handler.t

@ -73,7 +73,7 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-
ok($tf->handle_http($t) == 0, '404 handler => dynamic(nostatus)');
$t->{REQUEST} = ( <<EOF
GET /send404.pl HTTP/1.0
GET /cgi.pl?send404 HTTP/1.0
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'HTTP-Content' => "send404\n" } ];

10
tests/docroot/123/100.txt

@ -1,10 +0,0 @@
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
abcdefghi

1
tests/docroot/123/12345.html

@ -1 +0,0 @@
12345

1
tests/docroot/123/12345.txt

@ -1 +0,0 @@
12345

1
tests/docroot/123/Makefile.am

@ -1 +0,0 @@
EXTRA_DIST=100.txt 12345.html 12345.txt dummyfile.bla

1
tests/docroot/123/dummyfile.bla

@ -1 +0,0 @@
12345

2
tests/docroot/Makefile.am

@ -1,2 +1,2 @@
SUBDIRS=123 www
SUBDIRS=www
GNUMAKEFLAGS=--no-print-directory -s

8
tests/docroot/www/Makefile.am

@ -1,21 +1,13 @@
EXTRA_DIST=\
404.html \
404.pl \
cgi-pathinfo.pl \
cgi.pl \
crlfcrash.pl \
exec-date.shtml \
get-header.pl \
get-post-len.pl \
index.html \
index.txt \
ip.pl \
nph-status.pl \
prefix.fcgi \
send404.pl \
ssi-include.shtml \
ssi-include.txt \
ssi.shtml
SUBDIRS=\
expire \
indexfile

7
tests/docroot/www/cgi-pathinfo.pl

@ -1,7 +0,0 @@
#!/usr/bin/env perl
print "Content-Type: text/html\r\n\r\n";
print $ENV{"PATH_INFO"};
0;

47
tests/docroot/www/cgi.pl

@ -1,15 +1,29 @@
#!/usr/bin/env perl
# env
if ($ENV{"QUERY_STRING"} =~ /^env=(\w+)/) {
print "Status: 200\r\n\r\n$ENV{$1}";
exit 0;
}
# redirection
if ($ENV{"QUERY_STRING"} eq "internal-redir") {
print "Location: /cgi-pathinfo.pl/foo\r\n\r\n";
print "Location: /indexfile/index.pl/foo\r\n\r\n";
exit 0;
}
# redirection
if ($ENV{"QUERY_STRING"} eq "external-redir") {
print "Location: http://www.example.org:2048/\r\n\r\n";
exit 0;
}
# 404
if ($ENV{"QUERY_STRING"} eq "send404") {
print "Status: 404\n\nsend404\n";
exit 0;
}
# X-Sendfile
if ($ENV{"QUERY_STRING"} eq "xsendfile") {
# urlencode path for CGI header
@ -25,15 +39,34 @@ if ($ENV{"QUERY_STRING"} eq "xsendfile") {
exit 0;
}
# env
if ($ENV{"QUERY_STRING"} =~ /^env=(\w+)/) {
print "Status: 200\r\n\r\n$ENV{$1}";
# NPH
if ($ENV{"QUERY_STRING"} =~ /^nph=(\w+)/) {
print "Status: $1 FooBar\r\n\r\n";
exit 0;
}
# default
print "Content-Type: text/html\r\n\r\n";
# crlfcrash
if ($ENV{"QUERY_STRING"} eq "crlfcrash") {
print "Location: http://www.example.org/\r\n\n\n";
exit 0;
}
print $ENV{"SCRIPT_NAME"};
# POST length
if ($ENV{"QUERY_STRING"} eq "post-len") {
$cl = $ENV{CONTENT_LENGTH} || 0;
my $len = 0;
if ($ENV{"REQUEST_METHOD"} eq "POST") {
while (<>) { # expect test data to end in newline
$len += length($_);
last if $len >= $cl;
}
}
print "Status: 200\r\n\r\n$len";
exit 0;
}
# default
print "Content-Type: text/plain\r\n\r\n";
print $ENV{"QUERY_STRING"};
0;

4
tests/docroot/www/crlfcrash.pl

@ -1,4 +0,0 @@
#!/usr/bin/env perl
#
print "Location: http://www.example.org/\r\n\n\n";
exit;

1
tests/docroot/www/expire/Makefile.am

@ -1 +0,0 @@
EXTRA_DIST=access.txt modification.txt

0
tests/docroot/www/expire/access.txt

0
tests/docroot/www/expire/modification.txt

8
tests/docroot/www/get-header.pl

@ -1,8 +0,0 @@
#!/usr/bin/env perl
my $s = $ENV{$ENV{"QUERY_STRING"}};
printf("Content-Length: %d\r\n", length($s));
print "Content-Type: text/plain\r\n\r\n";
print $s;

13
tests/docroot/www/get-post-len.pl

@ -1,13 +0,0 @@
#!/usr/bin/env perl
print "Content-Type: text/plain\r\n\r\n";
if ($ENV{"REQUEST_METHOD"} eq "POST") {
my $l = 0;
while(<>) {
$l += length($_);
}
print $l;
} else {
print "0";
}

2
tests/docroot/www/indexfile/Makefile.am

@ -1 +1 @@
EXTRA_DIST=index.pl query_string.pl
EXTRA_DIST=index.pl

3
tests/docroot/www/indexfile/query_string.pl

@ -1,3 +0,0 @@
#!/usr/bin/env perl
print "Status: 200\n\n$ENV{QUERY_STRING}"

13
tests/docroot/www/ip.pl

@ -1,13 +0,0 @@
#!/usr/bin/env perl
print "Content-Type: text/html\r\n\r\n";
print $ENV{'REMOTE_ADDR'};
if ($ENV{'QUERY_STRING'} eq 'info') {
print "\nF:",$ENV{'HTTP_X_FORWARDED_FOR'},"\n";
while (my($key, $value) = each %ENV) {
printf "%s => %s\n", $key, $value;
}
}
0;

10
tests/docroot/www/nph-status.pl

@ -1,10 +0,0 @@
#!/usr/bin/env perl
my $status = 200;
if (defined $ENV{"QUERY_STRING"}) {
$status = $ENV{"QUERY_STRING"};
}
print "HTTP/1.0 ".$status." FooBar\r\n";
print "\r\n";

6
tests/docroot/www/send404.pl

@ -1,6 +0,0 @@
#!/usr/bin/env perl
print "Status: 404\n",
"Content-Type: text/plain\n",
"\n",
"send404\n";

43
tests/mod-cgi.t

@ -8,7 +8,7 @@ BEGIN {
use strict;
use IO::Socket;
use Test::More tests => 24;
use Test::More tests => 23;
use LightyTest;
my $tf = LightyTest->new();
@ -37,7 +37,7 @@ EOF
}
$t->{REQUEST} = ( <<EOF
GET /cgi.pl/foo HTTP/1.0
GET /cgi.pl/foo?env=SCRIPT_NAME HTTP/1.0
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/cgi.pl' } ];
@ -75,70 +75,63 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 302, 'Locat
ok($tf->handle_http($t) == 0, 'Trailing slash as path-info (#1989: workaround broken operating systems)');
$t->{REQUEST} = ( <<EOF
GET /cgi-pathinfo.pl/foo HTTP/1.0
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/foo' } ];
ok($tf->handle_http($t) == 0, 'perl via cgi + pathinfo');
$t->{REQUEST} = ( <<EOF
GET /nph-status.pl?30 HTTP/1.0
GET /cgi.pl?nph=30 HTTP/1.0
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 502 } ];
ok($tf->handle_http($t) == 0, 'NPH + perl, invalid status-code (#14)');
$t->{REQUEST} = ( <<EOF
GET /nph-status.pl?304 HTTP/1.0
GET /cgi.pl?nph=304 HTTP/1.0
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 304 } ];
ok($tf->handle_http($t) == 0, 'NPH + perl, setting status-code (#1125)');
$t->{REQUEST} = ( <<EOF
GET /nph-status.pl?200 HTTP/1.0
GET /cgi.pl?nph=200 HTTP/1.0
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
ok($tf->handle_http($t) == 0, 'NPH + perl, setting status-code');
$t->{REQUEST} = ( <<EOF
GET /get-header.pl?GATEWAY_INTERFACE HTTP/1.0
GET /cgi.pl?env=GATEWAY_INTERFACE HTTP/1.0
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'CGI/1.1' } ];
ok($tf->handle_http($t) == 0, 'cgi-env: GATEWAY_INTERFACE');
$t->{REQUEST} = ( <<EOF
GET /get-header.pl?QUERY_STRING HTTP/1.0
GET /cgi.pl?query_string HTTP/1.0
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'QUERY_STRING' } ];
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'query_string', 'Content-Type' => 'text/plain' } ];
ok($tf->handle_http($t) == 0, 'cgi-env: QUERY_STRING');
$t->{REQUEST} = ( <<EOF
GET /get-header.pl?SCRIPT_NAME HTTP/1.0
GET /cgi.pl?env=SCRIPT_NAME HTTP/1.0
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/get-header.pl' } ];
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/cgi.pl' } ];
ok($tf->handle_http($t) == 0, 'cgi-env: SCRIPT_NAME');
$t->{REQUEST} = ( <<EOF
GET /get-header.pl/path/info?SCRIPT_NAME HTTP/1.0
GET /cgi.pl/path/info?env=SCRIPT_NAME HTTP/1.0
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/get-header.pl' } ];
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/cgi.pl' } ];
ok($tf->handle_http($t) == 0, 'cgi-env: SCRIPT_NAME w/ PATH_INFO');
$t->{REQUEST} = ( <<EOF
GET /get-header.pl/path/info?PATH_INFO HTTP/1.0
GET /cgi.pl/path/info?env=PATH_INFO HTTP/1.0
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/path/info' } ];
ok($tf->handle_http($t) == 0, 'cgi-env: PATH_INFO');
$t->{REQUEST} = ( <<EOF
GET /get-header.pl?HTTP_XX_YY123 HTTP/1.0
GET /cgi.pl?env=HTTP_XX_YY123 HTTP/1.0
xx-yy123: foo
EOF
);
@ -146,15 +139,15 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-
ok($tf->handle_http($t) == 0, 'cgi-env: quoting headers with numbers');
$t->{REQUEST} = ( <<EOF
GET /get-header.pl?HTTP_HOST HTTP/1.0
GET /cgi.pl?env=HTTP_HOST HTTP/1.0
Host: www.example.org
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'www.example.org', 'Content-Type' => 'text/plain' } ];
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'www.example.org' } ];
ok($tf->handle_http($t) == 0, 'cgi-env: HTTP_HOST');
$t->{REQUEST} = ( <<EOF
GET /get-header.pl?HTTP_HOST HTTP/1.1
GET /cgi.pl?env=HTTP_HOST HTTP/1.1
Host: www.example.org
Connection: close
EOF
@ -164,7 +157,7 @@ ok($tf->handle_http($t) == 0, 'cgi-env: HTTP_HOST');
# broken header crash
$t->{REQUEST} = ( <<EOF
GET /crlfcrash.pl HTTP/1.0
GET /cgi.pl?crlfcrash HTTP/1.0
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 302, 'Location' => 'http://www.example.org/' } ];

8
tests/mod-extforward.t

@ -19,7 +19,7 @@ $tf->{CONFIGFILE} = 'mod-extforward.conf';
ok($tf->start_proc == 0, "Starting lighttpd") or die();
$t->{REQUEST} = ( <<EOF
GET /ip.pl HTTP/1.0
GET /cgi.pl?env=REMOTE_ADDR HTTP/1.0
Host: www.example.org
X-Forwarded-For: 127.0.10.1
EOF
@ -28,7 +28,7 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-
ok($tf->handle_http($t) == 0, 'expect 127.0.10.1, from single ip');
$t->{REQUEST} = ( <<EOF
GET /ip.pl HTTP/1.0
GET /cgi.pl?env=REMOTE_ADDR HTTP/1.0
Host: www.example.org
X-Forwarded-For: 127.0.10.1, 127.0.20.1
EOF
@ -37,7 +37,7 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-
ok($tf->handle_http($t) == 0, 'expect 127.0.20.1, from two ips');
$t->{REQUEST} = ( <<EOF
GET /ip.pl HTTP/1.0
GET /cgi.pl?env=REMOTE_ADDR HTTP/1.0
Host: www.example.org
X-Forwarded-For: 127.0.10.1, 127.0.20.1, 127.0.30.1
EOF
@ -46,7 +46,7 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-
ok($tf->handle_http($t) == 0, 'expect 127.0.20.1, from chained proxies');
$t->{REQUEST} = ( <<EOF
GET /ip.pl HTTP/1.0
GET /cgi.pl?env=REMOTE_ADDR HTTP/1.0
Host: www.example.org
Forwarded: for=127.0.10.1, for=127.0.20.1;proto=https, for=127.0.30.1;proto=http
EOF

10
tests/mod-setenv.t

@ -17,7 +17,7 @@ my $t;
ok($tf->start_proc == 0, "Starting lighttpd") or die();
$t->{REQUEST} = ( <<EOF
GET /get-header.pl?TRAC_ENV HTTP/1.0
GET /cgi.pl?env=TRAC_ENV HTTP/1.0
Host: www.example.org
EOF
);
@ -25,7 +25,7 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP
ok($tf->handle_http($t) == 0, 'query first setenv');
$t->{REQUEST} = ( <<EOF
GET /get-header.pl?SETENV HTTP/1.0
GET /cgi.pl?env=SETENV HTTP/1.0
Host: www.example.org
EOF
);
@ -33,7 +33,7 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP
ok($tf->handle_http($t) == 0, 'query second setenv');
$t->{REQUEST} = ( <<EOF
GET /get-header.pl?NEWENV HTTP/1.0
GET /cgi.pl?env=NEWENV HTTP/1.0
Host: www.example.org
EOF
);
@ -41,7 +41,7 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP
ok($tf->handle_http($t) == 0, 'query set-environment');
$t->{REQUEST} = ( <<EOF
GET /get-header.pl?HTTP_FOO HTTP/1.0
GET /cgi.pl?env=HTTP_FOO HTTP/1.0
Host: www.example.org
EOF
);
@ -49,7 +49,7 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP
ok($tf->handle_http($t) == 0, 'query add-request-header');
$t->{REQUEST} = ( <<EOF
GET /get-header.pl?HTTP_FOO2 HTTP/1.0
GET /cgi.pl?env=HTTP_FOO2 HTTP/1.0
Host: www.example.org
EOF
);

26
tests/prepare.sh

@ -35,21 +35,35 @@ cp "${srcdir}/docroot/www/"*.html \
"${srcdir}/docroot/www/"*.shtml \
"${srcdir}/docroot/www/"*.txt \
"${tmpdir}/servers/www.example.org/pages/"
cp "${srcdir}/docroot/www/expire/"*.txt "${tmpdir}/servers/www.example.org/pages/expire/"
cp "${srcdir}/docroot/www/indexfile/"*.pl "${tmpdir}/servers/www.example.org/pages/indexfile/"
cp "${srcdir}/docroot/123/"*.txt \
"${srcdir}/docroot/123/"*.html \
"${srcdir}/docroot/123/"*.bla \
"${tmpdir}/servers/123.example.org/pages/"
cp "${srcdir}/lighttpd.user" "${tmpdir}/"
cp "${srcdir}/lighttpd.htpasswd" "${tmpdir}/"
cp "${srcdir}/var-include-sub.conf" "${tmpdir}/../"
# create some content
touch "${tmpdir}/servers/www.example.org/pages/image.jpg" \
"${tmpdir}/servers/www.example.org/pages/image.JPG" \
"${tmpdir}/servers/www.example.org/pages/Foo.txt" \
"${tmpdir}/servers/www.example.org/pages/a" \
"${tmpdir}/servers/www.example.org/pages/index.html~"
"${tmpdir}/servers/www.example.org/pages/index.html~" \
"${tmpdir}/servers/www.example.org/pages/expire/access.txt" \
"${tmpdir}/servers/www.example.org/pages/expire/modification.txt"
echo "12345" > "${tmpdir}/servers/123.example.org/pages/12345.txt"
echo "12345" > "${tmpdir}/servers/123.example.org/pages/12345.html"
echo "12345" > "${tmpdir}/servers/123.example.org/pages/dummyfile.bla"
echo "12345" > "${tmpdir}/servers/123.example.org/pages/range.pdf"
cat - <<HERE > "${tmpdir}/servers/123.example.org/pages/100.txt"
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
abcdefghi
HERE
printf "%-40s" "preparing infrastructure"
[ -z "$MAKELEVEL" ] && echo

2
tests/proxy.conf

@ -28,5 +28,5 @@ proxy.server = ( "" => (
))
url.rewrite = (
"^/rewrite/all(/.*)$" => "/indexfile/query_string.pl?$1",
"^/rewrite/all(/.*)$" => "/cgi.pl?$1",
)

18
tests/request.t

@ -106,7 +106,7 @@ ok($tf->handle_http($t) == 0, 'HEAD request, file-not-found, query-string');
# (expect 200 OK instead of 100 Continue since request body sent with request)
# (if we waited to send request body, would expect 100 Continue, first)
$t->{REQUEST} = ( <<EOF
POST /get-post-len.pl HTTP/1.1
POST /cgi.pl?post-len HTTP/1.1
Host: www.example.org
Connection: close
Content-Type: application/x-www-form-urlencoded
@ -122,7 +122,7 @@ ok($tf->handle_http($t) == 0, 'Continue, Expect');
# note Transfer-Encoding: chunked tests will fail with 411 Length Required if
# server.stream-request-body != 0 in lighttpd.conf
$t->{REQUEST} = ( <<EOF
POST /get-post-len.pl HTTP/1.1
POST /cgi.pl?post-len HTTP/1.1
Host: www.example.org
Connection: close
Content-Type: application/x-www-form-urlencoded
@ -138,7 +138,7 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ];
ok($tf->handle_http($t) == 0, 'POST via Transfer-Encoding: chunked, lc hex');
$t->{REQUEST} = ( <<EOF
POST /get-post-len.pl HTTP/1.1
POST /cgi.pl?post-len HTTP/1.1
Host: www.example.org
Connection: close
Content-Type: application/x-www-form-urlencoded
@ -154,7 +154,7 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ];
ok($tf->handle_http($t) == 0, 'POST via Transfer-Encoding: chunked, uc hex');
$t->{REQUEST} = ( <<EOF
POST /get-post-len.pl HTTP/1.1
POST /cgi.pl?post-len HTTP/1.1
Host: www.example.org
Connection: close
Content-Type: application/x-www-form-urlencoded
@ -170,7 +170,7 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ];
ok($tf->handle_http($t) == 0, 'POST via Transfer-Encoding: chunked, two hex');
$t->{REQUEST} = ( <<EOF
POST /get-post-len.pl HTTP/1.1
POST /cgi.pl?post-len HTTP/1.1
Host: www.example.org
Connection: close
Content-Type: application/x-www-form-urlencoded
@ -187,7 +187,7 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ];
ok($tf->handle_http($t) == 0, 'POST via Transfer-Encoding: chunked, with trailer');
$t->{REQUEST} = ( <<EOF
POST /get-post-len.pl HTTP/1.1
POST /cgi.pl?post-len HTTP/1.1
Host: www.example.org
Connection: close
Content-Type: application/x-www-form-urlencoded
@ -203,7 +203,7 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ];
ok($tf->handle_http($t) == 0, 'POST via Transfer-Encoding: chunked, chunked header comment');
$t->{REQUEST} = ( <<EOF
POST /get-post-len.pl HTTP/1.1
POST /cgi.pl?post-len HTTP/1.1
Host: www.example.org
Connection: close
Content-Type: application/x-www-form-urlencoded
@ -219,7 +219,7 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 400 } ];
ok($tf->handle_http($t) == 0, 'POST via Transfer-Encoding: chunked; bad chunked header');
$t->{REQUEST} = ( <<EOF
POST /get-post-len.pl HTTP/1.1
POST /cgi.pl?post-len HTTP/1.1
Host: www.example.org
Connection: close
Content-Type: application/x-www-form-urlencoded
@ -235,7 +235,7 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 400 } ];
ok($tf->handle_http($t) == 0, 'POST via Transfer-Encoding: chunked; mismatch chunked header size and chunked data size');
$t->{REQUEST} = ( <<EOF
POST /get-post-len.pl HTTP/1.1
POST /cgi.pl?post-len HTTP/1.1
Host: www.example.org
Connection: close
Content-Type: application/x-www-form-urlencoded

Loading…
Cancel
Save