Skip to content

Disable max_body_size #1210

Closed Answered by ac000
ruspaul013 asked this question in Support
Apr 3, 2024 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

It's not currently. But seems trivial to do so..

diff --git a/src/nxt_http_request.c b/src/nxt_http_request.c
index 425a4607..abf00c86 100644
--- a/src/nxt_http_request.c
+++ b/src/nxt_http_request.c
@@ -230,7 +230,7 @@ nxt_http_request_content_length(void *ctx, nxt_http_field_t *field,
 
             max_body_size = r->conf->socket_conf->max_body_size;
 
-            if (nxt_slow_path(n > max_body_size)) {
+            if (nxt_slow_path(max_body_size != -1 && n > max_body_size)) {
                 return NXT_HTTP_PAYLOAD_TOO_LARGE;
             }
 

That will let you set

    "settings": {
        "http": {
            "max_body_size": -1
        }
    },

Quick test shows it to work...

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@ruspaul013
Comment options

Answer selected by ruspaul013
Comment options

You must be logged in to vote
1 reply
@ac000
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants