Skip to content

Commit c7cacf8

Browse files
committed
Fix xml processing tests
1 parent 63af830 commit c7cacf8

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

tests/regression/rule/10-xml.t

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,13 @@
169169
phase:2,deny,id:12345"
170170
),
171171
match_log => {
172-
debug => [ qr/XML: Initialising parser.*XML: Parsing complete \(well_formed 0\).*XML parser error.*validation failed because content is not well formed/s, 1 ],
173-
-debug => [ qr/Failed to load|Successfully validated/, 1 ],
174-
-error => [ qr/Failed to load|Successfully validated/, 1 ],
175-
audit => [ qr/^Message: .*Failed parsing document.*\nMessage:/m, 1 ],
172+
debug => [ qr/XML: Initialising parser.*XML: Parsing complete \(well_formed 0\).*XML parser error: XML: Failed to parse document./s, 1 ],
173+
debug => [ qr/XML parser error: XML: Failed to parse document./, 1 ],
174+
error => [ qr/XML parser error: XML: Failed to parse document./, 1 ],
175+
audit => [ qr/XML parser error: XML: Failed to parse document./m, 1 ],
176176
},
177177
match_response => {
178-
status => qr/^403$/,
178+
status => qr/^500$/,
179179
},
180180
request => new HTTP::Request(
181181
POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",
@@ -350,19 +350,21 @@
350350
SecXmlExternalEntity On
351351
SecDebugLog $ENV{DEBUG_LOG}
352352
SecDebugLogLevel 9
353+
SecAuditEngine RelevantOnly
354+
SecAuditLog "$ENV{AUDIT_LOG}"
353355
SecRule REQUEST_HEADERS:Content-Type "^text/xml\$" "id:500026, \\
354356
phase:1,t:none,t:lowercase,nolog,pass,ctl:requestBodyProcessor=XML"
355357
SecRule REQBODY_PROCESSOR "!^XML\$" nolog,pass,skipAfter:12345,id:500027
356358
SecRule XML "\@validateDTD $ENV{CONF_DIR}/SoapEnvelope.dtd" "id:500028, \\
357359
phase:2,deny,id:12345"
358360
),
359361
match_log => {
360-
debug => [ qr/XML: Initialising parser.*XML: Parsing complete \(well_formed 0\).*XML parser error.*validation failed because content is not well formed/s, 1 ],
361-
-debug => [ qr/Failed to load|Successfully validated/, 1 ],
362-
-error => [ qr/Failed to load|Successfully validated/, 1 ],
362+
debug => [ qr/XML: Initialising parser.*XML: Parsing complete \(well_formed 0\).*XML parser error: XML: Failed to parse document./s, 1 ],
363+
debug => [ qr/XML parser error: XML: Failed to parse document./, 1 ],
364+
audit => [ qr/^Message: .*Failed to parse document.*\nMessage:/m, 1 ],
363365
},
364366
match_response => {
365-
status => qr/^403$/,
367+
status => qr/^500$/,
366368
},
367369
request => new HTTP::Request(
368370
POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",

0 commit comments

Comments
 (0)