Commit 341fd852 authored by Nils Goroll's avatar Nils Goroll

Back to Expect handling according to rfc7231

Revert a regressive nit from bdd84ffc which
has nothing to do with H/2

https://tools.ietf.org/html/rfc7231#section-5.1.1

   Requirements for servers:

   o  A server that receives a 100-continue expectation in an HTTP/1.0
      request MUST ignore that expectation.

So if Expect exists but is not "100-continue", we send the 417 irrespective
of the protocol version.

But if is is 100-continue and the protocol is HTTP/1.0 or below, we ignore
the header.
parent dcdb2504
......@@ -66,14 +66,14 @@ CNT_GotReq(struct worker *wrk, struct req *req)
AN(req->transport->minimal_response);
if (http_GetHdr(req->http, H_Expect, &p)) {
if (strcasecmp(p, "100-continue") ||
req->http->protover < 11) {
if (strcasecmp(p, "100-continue")) {
req->doclose = SC_RX_JUNK;
(void)req->transport->minimal_response(req, 417);
wrk->stats->client_req_417++;
return (-1);
}
if (req->htc->pipeline_b == NULL) // XXX: HTTP1 vs 2 ?
if (req->http->protover >= 11 &&
req->htc->pipeline_b == NULL) // XXX: HTTP1 vs 2 ?
req->want100cont = 1;
http_Unset(req->http, H_Expect);
}
......
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