mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 13:56:01 +03:00
Fixed: Nginx return 500 when request body is off
This commit is contained in:
parent
df383b9b80
commit
43162f52cf
@ -387,9 +387,11 @@ ngx_http_modsecurity_handler(ngx_http_request_t *r)
|
||||
return NGX_DONE;
|
||||
}
|
||||
/* other method */
|
||||
if(modsecIsRequestBodyAccessEnabled(ctx->req)) {
|
||||
rc = modsecProcessRequestBody(ctx->req);
|
||||
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "ModSecurity: modsecProcessRequestBody %d", rc);
|
||||
}
|
||||
}
|
||||
|
||||
if (rc != DECLINED) {
|
||||
|
||||
@ -430,13 +432,15 @@ ngx_http_modsecurity_body_handler(ngx_http_request_t *r)
|
||||
return ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
rc = DECLINED;
|
||||
r->request_body = NULL;
|
||||
|
||||
modsecSetBodyBrigade(ctx->req, ctx->brigade);
|
||||
|
||||
if(modsecIsRequestBodyAccessEnabled(ctx->req))
|
||||
if(modsecIsRequestBodyAccessEnabled(ctx->req)) {
|
||||
rc = modsecProcessRequestBody(ctx->req);
|
||||
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "ModSecurity: modsecProcessRequestBody %d", rc);
|
||||
}
|
||||
|
||||
if (rc != DECLINED) {
|
||||
/* Nginx and Apache share same response code */
|
||||
|
Loading…
x
Reference in New Issue
Block a user