mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 03:34:29 +03:00
Allow no-key, single-value JSON body
This commit is contained in:
@@ -27,8 +27,7 @@ int json_add_argument(modsec_rec *msr, const char *value, unsigned length)
|
||||
* to reference this argument; for now we simply ignore these
|
||||
*/
|
||||
if (!msr->json->current_key) {
|
||||
msr_log(msr, 3, "Cannot add scalar value without an associated key");
|
||||
return 1;
|
||||
msr->json->current_key = "";
|
||||
}
|
||||
|
||||
arg = (msc_arg *) apr_pcalloc(msr->mp, sizeof(msc_arg));
|
||||
|
@@ -39,7 +39,7 @@ struct json_data {
|
||||
|
||||
/* prefix is used to create data hierarchy (i.e., 'parent.child.value') */
|
||||
unsigned char *prefix;
|
||||
unsigned char *current_key;
|
||||
const unsigned char *current_key;
|
||||
long int current_depth;
|
||||
int depth_limit_exceeded;
|
||||
};
|
||||
|
Reference in New Issue
Block a user