From 029deacf85a302cf52453dc3f6c2ce98d6587ba4 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sun, 20 Oct 2019 13:06:29 +0000 Subject: [PATCH] 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 --- docs/log-message-tags/next-number | 2 +- modules/proxy/mod_proxy_http.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/log-message-tags/next-number b/docs/log-message-tags/next-number index 378db28384..62f78dcd1d 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 152da01433..3ad927709f 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 -- 2.50.1