Introducing new return value (-8) in modsecurity_request_body_end when failing to parse JSON bodies; which in turn results in a 400 Bad Request resposne status code in nginx
This commit is contained in:
Родитель
e0e3c52581
Коммит
65e7edc76e
|
@ -1084,6 +1084,13 @@ static int hook_request_late(request_rec *r) {
|
|||
r->connection->keepalive = AP_CONN_CLOSE;
|
||||
return HTTP_BAD_REQUEST;
|
||||
break;
|
||||
case -8 : /* JSON body does not parse */
|
||||
if (my_error_msg != NULL) {
|
||||
msr_log(msr, 4, "%s", my_error_msg);
|
||||
}
|
||||
r->connection->keepalive = AP_CONN_CLOSE;
|
||||
return HTTP_BAD_REQUEST;
|
||||
break;
|
||||
default :
|
||||
/* allow through */
|
||||
break;
|
||||
|
|
|
@ -715,7 +715,7 @@ apr_status_t modsecurity_request_body_end(modsec_rec *msr, char **error_msg) {
|
|||
msr->msc_reqbody_error = 1;
|
||||
msr->msc_reqbody_error_msg = *error_msg;
|
||||
msr_log(msr, 2, "%s", *error_msg);
|
||||
return -1;
|
||||
return -8;
|
||||
}
|
||||
#else
|
||||
*error_msg = apr_psprintf(msr->mp, "JSON support was not enabled");
|
||||
|
|
Загрузка…
Ссылка в новой задаче