17bfed
diff --git a/docs/manual/mod/core.html.en b/docs/manual/mod/core.html.en
17bfed
index e1ec8d0..833fa7b 100644
17bfed
--- a/docs/manual/mod/core.html.en
17bfed
+++ b/docs/manual/mod/core.html.en
17bfed
@@ -2748,16 +2748,16 @@ subrequests
17bfed
 Description:Restricts the total size of the HTTP request body sent
17bfed
 from the client
17bfed
 Syntax:LimitRequestBody bytes
17bfed
-Default:LimitRequestBody 0
17bfed
+Default:LimitRequestBody 1073741824
17bfed
 Context:server config, virtual host, directory, .htaccess
17bfed
 Override:All
17bfed
 Status:Core
17bfed
 Module:core
17bfed
+Compatibility:In Apache HTTP Server 2.4.53 and earlier, the default value
17bfed
+    was 0 (unlimited)
17bfed
 
17bfed
-    

This directive specifies the number of bytes from 0

17bfed
-    (meaning unlimited) to 2147483647 (2GB) that are allowed in a
17bfed
-    request body. See the note below for the limited applicability
17bfed
-    to proxy requests.

17bfed
+    

This directive specifies the number of bytes

17bfed
+    that are allowed in a request body. A value of 0 means unlimited.

17bfed
 
17bfed
     

The LimitRequestBody directive allows

17bfed
     the user to set a limit on the allowed size of an HTTP request
17bfed
@@ -2783,12 +2783,6 @@ from the client
17bfed
 
17bfed
     
LimitRequestBody 102400
17bfed
 
17bfed
-
17bfed
-    

For a full description of how this directive is interpreted by

17bfed
-    proxy requests, see the mod_proxy documentation.

17bfed
-    
17bfed
-
17bfed
-
17bfed
 
17bfed
 
top
17bfed
 
17bfed
diff --git a/docs/manual/mod/mod_proxy.html.en b/docs/manual/mod/mod_proxy.html.en
17bfed
index 2cc6ace..c9e4634 100644
17bfed
--- a/docs/manual/mod/mod_proxy.html.en
17bfed
+++ b/docs/manual/mod/mod_proxy.html.en
17bfed
@@ -459,9 +459,6 @@ ProxyPass "/examples" "http://backend.example.com/examples" timeout=10
17bfed
     Content-Length header, but the server is configured to filter incoming
17bfed
     request bodies.

17bfed
 
17bfed
-    

LimitRequestBody only applies to

17bfed
-    request bodies that the server will spool to disk

17bfed
-
17bfed
     
top
17bfed
 
17bfed
 

Reverse Proxy Request Headers

17bfed
diff --git a/modules/http/http_filters.c b/modules/http/http_filters.c
17bfed
index 6bedcac..393343a 100644
17bfed
--- a/modules/http/http_filters.c
17bfed
+++ b/modules/http/http_filters.c
17bfed
@@ -1710,6 +1710,7 @@ AP_DECLARE(int) ap_setup_client_block(request_rec *r, int read_policy)
17bfed
 {
17bfed
     const char *tenc = apr_table_get(r->headers_in, "Transfer-Encoding");
17bfed
     const char *lenp = apr_table_get(r->headers_in, "Content-Length");
17bfed
+    apr_off_t limit_req_body = ap_get_limit_req_body(r);
17bfed
 
17bfed
     r->read_body = read_policy;
17bfed
     r->read_chunked = 0;
17bfed
@@ -1748,6 +1749,11 @@ AP_DECLARE(int) ap_setup_client_block(request_rec *r, int read_policy)
17bfed
         return HTTP_REQUEST_ENTITY_TOO_LARGE;
17bfed
     }
17bfed
 
17bfed
+    if (limit_req_body > 0 && (r->remaining > limit_req_body)) {
17bfed
+        /* will be logged when the body is discarded */
17bfed
+        return HTTP_REQUEST_ENTITY_TOO_LARGE;
17bfed
+    }
17bfed
+
17bfed
 #ifdef AP_DEBUG
17bfed
     {
17bfed
         /* Make sure ap_getline() didn't leave any droppings. */
17bfed
diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c
17bfed
index 7da9bde..1b7bb81 100644
17bfed
--- a/modules/proxy/mod_proxy_http.c
17bfed
+++ b/modules/proxy/mod_proxy_http.c
17bfed
@@ -439,13 +439,10 @@ static int spool_reqbody_cl(proxy_http_req_t *req, apr_off_t *bytes_spooled)
17bfed
     apr_bucket *e;
17bfed
     apr_off_t bytes, fsize = 0;
17bfed
     apr_file_t *tmpfile = NULL;
17bfed
-    apr_off_t limit;
17bfed
 
17bfed
     body_brigade = apr_brigade_create(p, bucket_alloc);
17bfed
     *bytes_spooled = 0;
17bfed
 
17bfed
-    limit = ap_get_limit_req_body(r);
17bfed
-
17bfed
     do {
17bfed
         if (APR_BRIGADE_EMPTY(input_brigade)) {
17bfed
             rv = stream_reqbody_read(req, input_brigade, 0);
17bfed
@@ -462,17 +459,6 @@ static int spool_reqbody_cl(proxy_http_req_t *req, apr_off_t *bytes_spooled)
17bfed
         apr_brigade_length(input_brigade, 1, &bytes);
17bfed
 
17bfed
         if (*bytes_spooled + bytes > MAX_MEM_SPOOL) {
17bfed
-            /*
17bfed
-             * LimitRequestBody does not affect Proxy requests (Should it?).
17bfed
-             * Let it take effect if we decide to store the body in a
17bfed
-             * temporary file on disk.
17bfed
-             */
17bfed
-            if (limit && (*bytes_spooled + bytes > limit)) {
17bfed
-                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01088)
17bfed
-                              "Request body is larger than the configured "
17bfed
-                              "limit of %" APR_OFF_T_FMT, limit);
17bfed
-                return HTTP_REQUEST_ENTITY_TOO_LARGE;
17bfed
-            }
17bfed
             /* can't spool any more in memory; write latest brigade to disk */
17bfed
             if (tmpfile == NULL) {
17bfed
                 const char *temp_dir;
17bfed
diff --git a/server/core.c b/server/core.c
17bfed
index 09664fc..084e243 100644
17bfed
--- a/server/core.c
17bfed
+++ b/server/core.c
17bfed
@@ -65,7 +65,7 @@
17bfed
 
17bfed
 /* LimitRequestBody handling */
17bfed
 #define AP_LIMIT_REQ_BODY_UNSET         ((apr_off_t) -1)
17bfed
-#define AP_DEFAULT_LIMIT_REQ_BODY       ((apr_off_t) 0)
17bfed
+#define AP_DEFAULT_LIMIT_REQ_BODY       ((apr_off_t) 1<<30) /* 1GB */
17bfed
 
17bfed
 /* LimitXMLRequestBody handling */
17bfed
 #define AP_LIMIT_UNSET                  ((long) -1)