summaryrefslogtreecommitdiff
path: root/tests/request.t
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2016-12-24 07:35:29 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2017-01-31 14:36:15 -0500
commit37dac9a23cbe5dd63c4b7bc19b01aa124f4740fd (patch)
tree989d3c8ae6cd5fb800e824bd37828da09778eccb /tests/request.t
parent82feb705880d8f7c42118224be403dbfe6bf8d1c (diff)
downloadlighttpd-git-37dac9a23cbe5dd63c4b7bc19b01aa124f4740fd.tar.gz
[core] support Expect: 100-continue with HTTP/1.1 (fixes #377, #1017, #1953, #2438)
support Expect: 100-continue with HTTP/1.1 requests Ignore config option server.reject-expect-100-with-417; server.reject-expect-100-with-417 will be removed in a future release. x-ref: "Incorrect handling of the 100 (Continue) Status" https://redmine.lighttpd.net/issues/377 "'Expect' header gives HTTP error 417" https://redmine.lighttpd.net/issues/1017 "Improve DAV support to be able to handle git as a client" https://redmine.lighttpd.net/issues/1953 "Change server.reject-expect-100-with-417 from flag to regular expression matching the URL" https://redmine.lighttpd.net/issues/2438
Diffstat (limited to 'tests/request.t')
-rwxr-xr-xtests/request.t11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/request.t b/tests/request.t
index a073a7c1..70f5ee5f 100755
--- a/tests/request.t
+++ b/tests/request.t
@@ -110,13 +110,20 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, '-HTTP-Content' => '' } ];
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
-GET / HTTP/1.1
+POST /get-post-len.pl HTTP/1.1
+Host: www.example.org
Connection: close
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 4
Expect: 100-continue
+
+123
EOF
);
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 417 } ];
+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ];
ok($tf->handle_http($t) == 0, 'Continue, Expect');
# note Transfer-Encoding: chunked tests will fail with 411 Length Required if