mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 11:16:33 +03:00
Print when request is blocked when it is larger than the configuration
This commit is contained in:
@@ -731,12 +731,17 @@ static int hook_request_late(request_rec *r) {
|
||||
if (msr->txcfg->reqbody_access == 1) {
|
||||
/* Check request body limit (non-chunked requests only). */
|
||||
if (msr->request_content_length > msr->txcfg->reqbody_limit) {
|
||||
msr_log(msr, 1, "Request body (Content-Length) is larger than the "
|
||||
"configured limit (%ld).", msr->txcfg->reqbody_limit);
|
||||
|
||||
msr->inbound_error = 1;
|
||||
|
||||
if(msr->txcfg->if_limit_action == REQUEST_BODY_LIMIT_ACTION_REJECT)
|
||||
if(msr->txcfg->if_limit_action == REQUEST_BODY_LIMIT_ACTION_REJECT) {
|
||||
msr_log(msr, 1, "Request body (Content-Length) is larger than the "
|
||||
"configured limit (%ld). Deny with status (%d)", msr->txcfg->reqbody_limit, r->status);
|
||||
return HTTP_REQUEST_ENTITY_TOO_LARGE;
|
||||
} else {
|
||||
msr_log(msr, 1, "Request body (Content-Length) is larger than the "
|
||||
"configured limit (%ld).", msr->txcfg->reqbody_limit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user