Commit 5af26056 authored by Nils Goroll's avatar Nils Goroll

Fix cases when we do not want to send a 100 Continue

- when we already started reading the body
- for HTTP Versions less than 1.1
parent 70ba8e03
......@@ -328,6 +328,7 @@ http1_dissect(struct worker *wrk, struct req *req)
wrk->stats->client_req_417++;
return (-1);
}
if (req->http->protover >= 11 && req->htc->pipeline_b == NULL)
req->want100cont = 1;
http_Unset(req->http, H_Expect);
}
......
varnishtest "Check Expect headers"
varnishtest "Check Expect headers / 100 Continue"
server s1 {
rxreq
txresp
rxreq
txresp
} -start
varnish v1 -vcl+backend { } -start
client c1 {
txreq -url "/" -req POST -hdr "Expect: 100-continue " -body "foo"
txreq -url "/" -req POST -hdr "Expect: 100-continue " \
-hdr "Content-Length: 20"
rxresp
expect resp.status == 100
send "01234567890123456789"
rxresp
expect resp.status == 200
txreq -url "/" -req POST -hdr "Expect: 100-continue " -body "foo"
rxresp
expect resp.status == 200
txreq -url "/" -req POST -hdr "Expect: 101-continue" -body "foo"
rxresp
expect resp.status == 417
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment