Allow ability to force request body buffering to memory. Fixes MODSEC-2.

This commit is contained in:
brectanus
2008-09-03 20:42:28 +00:00
parent 139d651bbf
commit 34798e9abe
8 changed files with 69 additions and 3 deletions

View File

@@ -713,6 +713,13 @@ static char *msre_action_ctl_validate(msre_engine *engine, msre_action *action)
*/
return NULL;
} else
if (strcasecmp(name, "requestBodyBuffering") == 0) {
if (parse_boolean(value) == -1) {
return apr_psprintf(engine->mp, "Invalid setting for ctl name "
" requestBodyBuffering: %s", value);
}
return NULL;
} else
if (strcasecmp(name, "responseBodyAccess") == 0) {
if (parse_boolean(value) == -1) {
return apr_psprintf(engine->mp, "Invalid setting for ctl name "
@@ -831,6 +838,16 @@ static apr_status_t msre_action_ctl_execute(modsec_rec *msr, apr_pool_t *mptmp,
return 1;
} else
if (strcasecmp(name, "requestBodyBuffering") == 0) {
int pv = parse_boolean(value);
if (pv == -1) return -1;
msr->txcfg->reqbody_buffering = pv;
msr->usercfg->reqbody_buffering = pv;
msr_log(msr, 4, "Ctl: Set requestBodyAccess to %d.", pv);
return 1;
} else
if (strcasecmp(name, "requestBodyProcessor") == 0) {
msr->msc_reqbody_processor = value;
msr_log(msr, 4, "Ctl: Set requestBodyProcessor to %s.", value);