Allow 0 length JSON requests. 0 len XML and multipart already allowed.

This commit is contained in:
Allan Boll 2017-11-20 12:17:42 -08:00 committed by Felipe Zimmerle
parent 9b6d4b2bb9
commit f15976f68f
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277
2 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,8 @@
DD MMM YYYY - 2.9.3 - To be released
------------------------------------
* Allow 0 length JSON requests.
[Issue #1822 - @allanbomsft, @zimmerle, @victorhora, @marcstern]
* Include unanmed JSON values in unnamed ARGS
[Issue #1577, #1576 - @marcstern, @victorhora, @zimmerle]
* Fix buffer size for utf8toUnicode transformation

View File

@ -710,7 +710,7 @@ apr_status_t modsecurity_request_body_end(modsec_rec *msr, char **error_msg) {
}
else if (strcmp(msr->msc_reqbody_processor, "JSON") == 0) {
#ifdef WITH_YAJL
if (json_complete(msr, &my_error_msg) < 0) {
if (json_complete(msr, &my_error_msg) < 0 && msr->msc_reqbody_length > 0) {
*error_msg = apr_psprintf(msr->mp, "JSON parser error: %s", my_error_msg);
msr->msc_reqbody_error = 1;
msr->msc_reqbody_error_msg = *error_msg;