Print when request is blocked when it is larger than the configuration

This commit is contained in:
brenosilva 2011-04-04 18:55:04 +00:00
parent ed06ed2aec
commit 1e2f836b32

View File

@ -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);
}
}
}