]> granicus.if.org Git - apache/commitdiff
mod_proxy_http: follow up to r1868576.
authorYann Ylavic <ylavic@apache.org>
Sun, 20 Oct 2019 13:06:29 +0000 (13:06 +0000)
committerYann Ylavic <ylavic@apache.org>
Sun, 20 Oct 2019 13:06:29 +0000 (13:06 +0000)
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
modules/proxy/mod_proxy_http.c

index 378db28384dea121a9938eace4cb7769f1668b4f..62f78dcd1dae091a2e1984884004604f5824d605 100644 (file)
@@ -1 +1 @@
-10206
+10207
index 152da0143361b3f5ddb361574e516a4be6f28838..3ad927709f062bf6ae278e21c28d3e07aa5d8f75 100644 (file)
@@ -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