Allow disabling processing of request body size limit in phase 1. See #518.

This commit is contained in:
brectanus 2008-08-15 20:21:25 +00:00
parent 5298e29540
commit 225339525d

View File

@ -570,19 +570,21 @@ static int hook_request_early(request_rec *r) {
return DECLINED;
}
/* Check request body limit (should only trigger on non-chunked requests). */
if (msr->request_content_length > msr->txcfg->reqbody_limit) {
msr_log(msr, 1, "Request body is larger than the "
"configured limit (%ld).", msr->txcfg->reqbody_limit);
return HTTP_REQUEST_ENTITY_TOO_LARGE;
}
/* Process phase REQUEST_HEADERS */
rc = DECLINED;
if (modsecurity_process_phase(msr, PHASE_REQUEST_HEADERS) > 0) {
rc = perform_interception(msr);
}
if ((msr->txcfg->is_enabled != MODSEC_DISABLED) && (rc == DECLINED)) {
/* 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);
return HTTP_REQUEST_ENTITY_TOO_LARGE;
}
}
return rc;
}