From: Yann Ylavic Date: Sun, 20 Oct 2019 13:06:29 +0000 (+0000) Subject: mod_proxy_http: follow up to r1868576. X-Git-Tag: 2.5.0-alpha2-ci-test-only~1862 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=029deacf85a302cf52453dc3f6c2ce98d6587ba4;p=thirdparty%2Fapache%2Fhttpd.git mod_proxy_http: follow up to r1868576. Omit sending 100 continue if the body is (partly) prefetched, per RFC 7231 (section 5.1.1). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1868653 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/log-message-tags/next-number b/docs/log-message-tags/next-number index 378db28384d..62f78dcd1da 100644 --- a/docs/log-message-tags/next-number +++ b/docs/log-message-tags/next-number @@ -1 +1 @@ -10206 +10207 diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c index 152da014336..3ad927709f0 100644 --- a/modules/proxy/mod_proxy_http.c +++ b/modules/proxy/mod_proxy_http.c @@ -674,6 +674,18 @@ static int ap_proxy_http_prefetch(proxy_http_req_t *req, apr_brigade_length(temp_brigade, 1, &bytes); bytes_read += bytes; + /* From https://tools.ietf.org/html/rfc7231#section-5.1.1 + * A server MAY omit sending a 100 (Continue) response if it has + * already received some or all of the message body for the + * corresponding request, or if [snip]. + */ + if (req->expecting_100 && bytes > 0) { + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, status, r, APLOGNO(10206) + "prefetching request body while 100-continue is" + "expected, omit sending interim response"); + req->expecting_100 = 0; + } + /* * Save temp_brigade in input_brigade. (At least) in the SSL case * temp_brigade contains transient buckets whose data would get