Blame tests/regression/rule/15-json.t

Packit 284210
### Test for JSON parser
Packit 284210
Packit 284210
### 
Packit 284210
# OK
Packit 284210
{
Packit 284210
	type => "rule",
Packit 284210
	comment => "json parser",
Packit 284210
	conf => qq(
Packit 284210
		SecRuleEngine On
Packit 284210
		SecRequestBodyAccess On
Packit 284210
		SecDebugLog $ENV{DEBUG_LOG}
Packit 284210
		SecDebugLogLevel 9
Packit 284210
		SecRule REQUEST_HEADERS:Content-Type "application/json" \\
Packit 284210
		     "id:'200001',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=JSON"
Packit 284210
		SecRule ARGS:foo "bar" "id:'200441',phase:3,log"
Packit 284210
	),
Packit 284210
	match_log => {
Packit 284210
		error => [ qr/ModSecurity: Warning. Pattern match "bar" at ARGS:foo.|ModSecurity: JSON support was not enabled/s, 1 ],
Packit 284210
		debug => [ qr/Adding JSON argument 'foo' with value 'bar'|JSON support was not enabled/, 1 ],
Packit 284210
	},
Packit 284210
	match_response => {
Packit 284210
		status => qr/^200$/,
Packit 284210
	},
Packit 284210
	request => new HTTP::Request(
Packit 284210
		POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",
Packit 284210
		[
Packit 284210
			"Content-Type" => "application/json",
Packit 284210
		],
Packit 284210
		normalize_raw_request_data(
Packit 284210
			q(
Packit 284210
				{
Packit 284210
					"foo":"bar",
Packit 284210
					"mod":"sec"
Packit 284210
				}
Packit 284210
			),
Packit 284210
		),
Packit 284210
	),
Packit 284210
}
Packit 284210