From dd5e0aa2c6167ce75df516da0e5e05f50a3f30d1 Mon Sep 17 00:00:00 2001 From: Hiroaki Nakamura Date: Tue, 16 Dec 2025 09:31:50 +0900 Subject: [PATCH 01/26] Allow partial processing of XML and JSON request body --- src/request_body_processor/json.cc | 5 +++-- src/request_body_processor/json.h | 2 +- src/request_body_processor/xml.cc | 10 +++++----- src/request_body_processor/xml.h | 3 ++- src/transaction.cc | 6 ++++-- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/request_body_processor/json.cc b/src/request_body_processor/json.cc index f56704effa..86004c8c4f 100644 --- a/src/request_body_processor/json.cc +++ b/src/request_body_processor/json.cc @@ -29,7 +29,8 @@ namespace RequestBodyProcessor { static const double json_depth_limit_default = 10000.0; static const char* json_depth_limit_exceeded_msg = ". Parsing depth limit exceeded"; -JSON::JSON(Transaction *transaction) : m_transaction(transaction), +JSON::JSON(Transaction *transaction, unsigned int allow_partial_values) + : m_transaction(transaction), m_handle(NULL), m_current_key(""), m_max_depth(json_depth_limit_default), @@ -69,7 +70,7 @@ JSON::JSON(Transaction *transaction) : m_transaction(transaction), */ m_handle = yajl_alloc(&callbacks, NULL, this); - yajl_config(m_handle, yajl_allow_partial_values, 0); + yajl_config(m_handle, yajl_allow_partial_values, allow_partial_values); } diff --git a/src/request_body_processor/json.h b/src/request_body_processor/json.h index 961ea94ea8..d542e85283 100644 --- a/src/request_body_processor/json.h +++ b/src/request_body_processor/json.h @@ -57,7 +57,7 @@ class JSONContainerMap : public JSONContainer { class JSON { public: - explicit JSON(Transaction *transaction); + explicit JSON(Transaction *transaction, unsigned int allow_partial_values = 0); ~JSON(); static bool init(); diff --git a/src/request_body_processor/xml.cc b/src/request_body_processor/xml.cc index cbb7894c9b..14576810f2 100644 --- a/src/request_body_processor/xml.cc +++ b/src/request_body_processor/xml.cc @@ -149,8 +149,8 @@ extern "C" { } } -XML::XML(Transaction *transaction) - : m_transaction(transaction) { +XML::XML(Transaction *transaction, bool require_well_formed) + : m_transaction(transaction), m_require_well_formed(require_well_formed) { m_data.doc = NULL; m_data.parsing_ctx = NULL; m_data.sax_handler = NULL; @@ -280,7 +280,7 @@ bool XML::processChunk(const char *buf, unsigned int size, != RulesSetProperties::OnlyArgsConfigXMLParseXmlIntoArgs) { xmlParseChunk(m_data.parsing_ctx, buf, size, 0); m_data.xml_parser_state->parsing_ctx_arg = m_data.parsing_ctx_arg; - if (m_data.parsing_ctx->wellFormed != 1) { + if (m_require_well_formed && m_data.parsing_ctx->wellFormed != 1) { error->assign("XML: Failed to parse document."); ms_dbg_a(m_transaction, 4, "XML: Failed to parse document."); return false; @@ -296,7 +296,7 @@ bool XML::processChunk(const char *buf, unsigned int size, == RulesSetProperties::TrueConfigXMLParseXmlIntoArgs) ) { xmlParseChunk(m_data.parsing_ctx_arg, buf, size, 0); - if (m_data.parsing_ctx_arg->wellFormed != 1) { + if (m_require_well_formed && m_data.parsing_ctx_arg->wellFormed != 1) { error->assign("XML: Failed to parse document for ARGS."); ms_dbg_a(m_transaction, 4, "XML: Failed to parse document for ARGS."); return false; @@ -326,7 +326,7 @@ bool XML::complete(std::string *error) { ms_dbg_a(m_transaction, 4, "XML: Parsing complete (well_formed " \ + std::to_string(m_data.well_formed) + ")."); - if (m_data.well_formed != 1) { + if (m_require_well_formed && m_data.well_formed != 1) { error->assign("XML: Failed to parse document."); ms_dbg_a(m_transaction, 4, "XML: Failed to parse document."); return false; diff --git a/src/request_body_processor/xml.h b/src/request_body_processor/xml.h index df766d03b7..0cc92e0416 100644 --- a/src/request_body_processor/xml.h +++ b/src/request_body_processor/xml.h @@ -85,7 +85,7 @@ typedef struct xml_data xml_data; class XML { public: - explicit XML(Transaction *transaction); + explicit XML(Transaction *transaction, bool require_well_formed = true); ~XML(); bool init(); bool processChunk(const char *buf, unsigned int size, std::string *err); @@ -98,6 +98,7 @@ class XML { private: Transaction *m_transaction; std::string m_header; + bool m_require_well_formed; }; #endif diff --git a/src/transaction.cc b/src/transaction.cc index 6c8ae9744c..a091c2666d 100644 --- a/src/transaction.cc +++ b/src/transaction.cc @@ -138,12 +138,14 @@ Transaction::Transaction(ModSecurity *ms, RulesSet *rules, const char *id, ms->m_session_collection, ms->m_user_collection, ms->m_resource_collection), #ifdef WITH_LIBXML2 - m_xml(new RequestBodyProcessor::XML(this)), + m_xml(new RequestBodyProcessor::XML(this, + this->m_rules->m_requestBodyLimitAction != RulesSet::BodyLimitAction::ProcessPartialBodyLimitAction)), #else m_xml(nullptr), #endif #ifdef WITH_YAJL - m_json(new RequestBodyProcessor::JSON(this)), + m_json(new RequestBodyProcessor::JSON(this, + this->m_rules->m_requestBodyLimitAction == RulesSet::BodyLimitAction::ProcessPartialBodyLimitAction)), #else m_json(nullptr), #endif From eb586180295448fc0ccb8da6cefd72abf398c049 Mon Sep 17 00:00:00 2001 From: Hiroaki Nakamura Date: Wed, 17 Dec 2025 17:38:12 +0900 Subject: [PATCH 02/26] Use spaces for indentations in regression/config_body_limits.json --- test/test-cases/regression/collection-tx.json | 2 +- .../regression/config-body_limits.json | 16 ++++++++-------- .../regression/issue-2423-msg-in-chain.json | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/test-cases/regression/collection-tx.json b/test/test-cases/regression/collection-tx.json index 07099405f7..7d2dea3f3e 100644 --- a/test/test-cases/regression/collection-tx.json +++ b/test/test-cases/regression/collection-tx.json @@ -30,7 +30,7 @@ ] }, "expected":{ - "http_code":200 + "http_code":200 }, "rules":[ "SecRuleEngine On", diff --git a/test/test-cases/regression/config-body_limits.json b/test/test-cases/regression/config-body_limits.json index c7ce75f949..4a48afc5be 100644 --- a/test/test-cases/regression/config-body_limits.json +++ b/test/test-cases/regression/config-body_limits.json @@ -404,7 +404,7 @@ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", - "Content-Length": "41", + "Content-Length": "41", "Content-Type": "application/x-www-form-urlencoded" }, "uri":"/", @@ -451,7 +451,7 @@ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", - "Content-Length": "41", + "Content-Length": "41", "Content-Type": "application/x-www-form-urlencoded" }, "uri":"/", @@ -497,7 +497,7 @@ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", - "Content-Length": "41", + "Content-Length": "41", "Content-Type": "application/json" }, "uri":"/", @@ -545,7 +545,7 @@ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", - "Content-Length": "41", + "Content-Length": "41", "Content-Type": "application/json" }, "uri":"/", @@ -593,7 +593,7 @@ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", - "Content-Length": "77", + "Content-Length": "77", "Content-Type": "application/xml" }, "uri":"/", @@ -642,7 +642,7 @@ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", - "Content-Length": "77", + "Content-Length": "77", "Content-Type": "application/xml" }, "uri":"/", @@ -689,7 +689,7 @@ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", - "Content-Length": "77", + "Content-Length": "77", "Content-Type": "multipart/form-data; boundary=0000" }, "uri":"/", @@ -744,7 +744,7 @@ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", - "Content-Length": "77", + "Content-Length": "77", "Content-Type": "multipart/form-data; boundary=0000" }, "uri":"/", diff --git a/test/test-cases/regression/issue-2423-msg-in-chain.json b/test/test-cases/regression/issue-2423-msg-in-chain.json index c667de0542..a9987faa75 100644 --- a/test/test-cases/regression/issue-2423-msg-in-chain.json +++ b/test/test-cases/regression/issue-2423-msg-in-chain.json @@ -109,7 +109,7 @@ "headers":{ "Host":"localhost", "Restricted":"attack", - "Other": "Value" + "Other": "Value" }, "uri":"/", "method":"GET" From 869972317dc7f28f31c0f3b27758132195098db8 Mon Sep 17 00:00:00 2001 From: Hiroaki Nakamura Date: Wed, 17 Dec 2025 19:46:58 +0900 Subject: [PATCH 03/26] Remove trailing spaces in regression test cases --- .../collection-case-insensitive.json | 18 +- ...llection-regular_expression_selection.json | 36 +- .../regression/collection-resource.json | 32 +- .../regression/collection-tx-with-macro.json | 72 ++-- test/test-cases/regression/collection-tx.json | 90 ++--- .../regression/config-body_limits.json | 144 +++---- test/test-cases/regression/issue-1825.json | 136 +++---- test/test-cases/regression/issue-2099.json | 2 +- test/test-cases/regression/issue-2427.json | 12 +- .../misc-variable-under-quotes.json | 42 +- .../regression/offset-variable.json | 114 +++--- .../regression/sec_component_signature.json | 8 +- test/test-cases/regression/variable-ARGS.json | 42 +- .../variable-ARGS_COMBINED_SIZE.json | 42 +- .../regression/variable-ARGS_GET.json | 94 ++--- .../regression/variable-ARGS_GET_NAMES.json | 42 +- .../regression/variable-ARGS_NAMES.json | 42 +- .../regression/variable-ARGS_POST.json | 2 +- .../test-cases/regression/variable-FILES.json | 24 +- .../variable-FILES_COMBINED_SIZE.json | 24 +- .../regression/variable-FILES_NAMES.json | 24 +- .../regression/variable-FILES_SIZES.json | 24 +- .../regression/variable-FULL_REQUEST.json | 24 +- .../variable-FULL_REQUEST_LENGTH.json | 24 +- test/test-cases/regression/variable-GEO.json | 362 +++++++++--------- .../regression/variable-HIGHEST_SEVERITY.json | 42 +- .../variable-INBOUND_DATA_ERROR.json | 44 +-- .../variable-MULTIPART_STRICT_ERROR.json | 10 +- ...variable-MULTIPART_UNMATCHED_BOUNDARY.json | 24 +- .../variable-OUTBOUND_DATA_ERROR.json | 44 +-- .../variable-REQBODY_PROCESSOR.json | 62 +-- .../variable-REQBODY_PROCESSOR_ERROR.json | 42 +- .../regression/variable-REQUEST_BODY.json | 24 +- .../variable-REQUEST_BODY_LENGTH.json | 24 +- .../regression/variable-REQUEST_HEADERS.json | 24 +- .../regression/variable-REQUEST_LINE.json | 22 +- .../regression/variable-REQUEST_METHOD.json | 22 +- .../regression/variable-REQUEST_PROTOCOL.json | 22 +- .../regression/variable-REQUEST_URI.json | 22 +- .../regression/variable-REQUEST_URI_RAW.json | 22 +- .../variable-RESPONSE_CONTENT_LENGTH.json | 22 +- .../variable-RESPONSE_CONTENT_TYPE.json | 22 +- .../regression/variable-RESPONSE_HEADERS.json | 24 +- .../variable-RESPONSE_PROTOCOL.json | 22 +- .../regression/variable-SERVER_NAME.json | 42 +- .../regression/variable-URLENCODED_ERROR.json | 42 +- .../variable-variation-exclusion.json | 42 +- 47 files changed, 1071 insertions(+), 1071 deletions(-) diff --git a/test/test-cases/regression/collection-case-insensitive.json b/test/test-cases/regression/collection-case-insensitive.json index 83c3a4d818..a2955fd0bb 100644 --- a/test/test-cases/regression/collection-case-insensitive.json +++ b/test/test-cases/regression/collection-case-insensitive.json @@ -4,16 +4,16 @@ "version_min":300000, "version_max":0, "title":"Testing collection :: Case insensitive (1/1)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":2313 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "User-Agent":"Mozilla\/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko\/20091102 Firefox\/3.5.5 (.NET CLR 3.5.30729)", "Accept":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8", "Accept-Language":"en-us,en;q=0.5", @@ -30,12 +30,12 @@ "http_version":1.1, "body":"" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Content-Type":"text\/xml; charset=utf-8\n\r", "Content-Length":"length\n\r" }, - "body":[ + "body":[ "\n\r", "\n\r", " \n\r", @@ -46,12 +46,12 @@ "<\/soap:Envelope>\n\r" ] }, - "expected":{ + "expected":{ "audit_log":"", "debug_log":"Target value: \"matched_var:PHPSESSID=rAAAAAAA2t5uvjq435r4q7ib3vtdjq120\" \\(Variable: TX:something\\)", "error_log":"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQUEST_headers \"@contains PHPSESSID\" \"id:1,t:lowercase,t:none,setvar:TX.something=matched_var:%{matched_var}%\"", "SecRule TX \"@contains to_test\" \"id:2,t:lowercase,t:none\"" diff --git a/test/test-cases/regression/collection-regular_expression_selection.json b/test/test-cases/regression/collection-regular_expression_selection.json index 5ac6db40a2..137b391030 100644 --- a/test/test-cases/regression/collection-regular_expression_selection.json +++ b/test/test-cases/regression/collection-regular_expression_selection.json @@ -4,16 +4,16 @@ "version_min":300000, "version_max":0, "title":"Testing collection :: TX/regular expression (1/2)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":2313 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "User-Agent":"Mozilla\/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko\/20091102 Firefox\/3.5.5 (.NET CLR 3.5.30729)", "Accept":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8", "Accept-Language":"en-us,en;q=0.5", @@ -30,12 +30,12 @@ "http_version":1.1, "body":"" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Content-Type":"text\/xml; charset=utf-8\n\r", "Content-Length":"length\n\r" }, - "body":[ + "body":[ "\n\r", "\n\r", " \n\r", @@ -46,13 +46,13 @@ "<\/soap:Envelope>\n\r" ] }, - "expected":{ + "expected":{ "audit_log":"", "debug_log":"Saving variable: IP:nah with value: nops", "error_log":"", "http_code":200 }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule ARGS:/^id_/ \"@contains test\" \"id:1,phase:2,t:lowercase,initcol:ip=%{REMOTE_ADDR}\"", "SecRule ARGS:/^id_/ \"@contains test\" \"id:2,phase:2,t:lowercase,setvar:IP.nah=nops\"", @@ -64,16 +64,16 @@ "version_min":300000, "version_max":0, "title":"Testing collection :: TX/regular expression (2/2)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":2313 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "User-Agent":"Mozilla\/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko\/20091102 Firefox\/3.5.5 (.NET CLR 3.5.30729)", "Accept":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8", "Accept-Language":"en-us,en;q=0.5", @@ -90,12 +90,12 @@ "http_version":1.1, "body":"" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Content-Type":"text\/xml; charset=utf-8\n\r", "Content-Length":"length\n\r" }, - "body":[ + "body":[ "\n\r", "\n\r", " \n\r", @@ -106,12 +106,12 @@ "<\/soap:Envelope>\n\r" ] }, - "expected":{ + "expected":{ "audit_log":"", "debug_log":"Saving variable: IP:id_a with value: nops", "http_code":403 }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule ARGS:/^id_/ \"@contains test\" \"id:11,phase:2,t:lowercase,initcol:ip=%{REMOTE_ADDR}\"", "SecRule ARGS:/^id_/ \"@contains test\" \"id:12,phase:2,t:lowercase,setvar:IP.id_a=nops\"", diff --git a/test/test-cases/regression/collection-resource.json b/test/test-cases/regression/collection-resource.json index b73d00cb14..2652ca493c 100644 --- a/test/test-cases/regression/collection-resource.json +++ b/test/test-cases/regression/collection-resource.json @@ -4,16 +4,16 @@ "version_min":300000, "version_max":0, "title":"Testing collection :: RESOURCE (1/2)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":2313 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "User-Agent":"Mozilla\/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko\/20091102 Firefox\/3.5.5 (.NET CLR 3.5.30729)", "Accept":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8", "Accept-Language":"en-us,en;q=0.5", @@ -30,20 +30,20 @@ "http_version":1.1, "body":"" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Content-Type":"text\/xml; charset=utf-8\n\r", "Content-Length":"length\n\r" }, "body":[ ] }, - "expected":{ + "expected":{ "audit_log":"", "debug_log":"Target value: \"123\" \\(Variable: RESOURCE:whee::::test\\)", "error_log":"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule ARGS:resource \"@unconditionalmatch \" \"phase:2,pass,initcol:resource=%{ARGS.resource},id:900003\"", "SecRule ARGS:resource \"@unconditionalmatch \" \"phase:2,pass,setvar:resource.test=123,id:900000\"", @@ -56,16 +56,16 @@ "version_min":300000, "version_max":0, "title":"Testing collection :: RESOURCE (2/2)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":2313 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "User-Agent":"Mozilla\/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko\/20091102 Firefox\/3.5.5 (.NET CLR 3.5.30729)", "Accept":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8", "Accept-Language":"en-us,en;q=0.5", @@ -82,20 +82,20 @@ "http_version":1.1, "body":"" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Content-Type":"text\/xml; charset=utf-8\n\r", "Content-Length":"length\n\r" }, "body":[ ] }, - "expected":{ + "expected":{ "audit_log":"", "debug_log":"RESOURCE:whee::webappid::test", "error_log":"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecWebAppId webappid", "SecRule ARGS:resource \"@unconditionalmatch \" \"phase:2,pass,initcol:resource=%{ARGS.resource},id:900003\"", diff --git a/test/test-cases/regression/collection-tx-with-macro.json b/test/test-cases/regression/collection-tx-with-macro.json index a0173b6bb6..3b4bd1e1f8 100644 --- a/test/test-cases/regression/collection-tx-with-macro.json +++ b/test/test-cases/regression/collection-tx-with-macro.json @@ -4,16 +4,16 @@ "version_min":300000, "version_max":0, "title":"Testing collection :: TX (with macro) (1/4)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":2313 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "User-Agent":"Mozilla\/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko\/20091102 Firefox\/3.5.5 (.NET CLR 3.5.30729)", "Accept":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8", "Accept-Language":"en-us,en;q=0.5", @@ -30,12 +30,12 @@ "http_version":1.1, "body":"" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Content-Type":"text\/xml; charset=utf-8\n\r", "Content-Length":"length\n\r" }, - "body":[ + "body":[ "\n\r", "\n\r", " \n\r", @@ -46,12 +46,12 @@ "<\/soap:Envelope>\n\r" ] }, - "expected":{ + "expected":{ "audit_log":"", "debug_log":"Target value: \"PHPSESSID=rAAAAAAA2t5uvjq435r4q7ib3vtdjq120\" \\(Variable: TX:something\\)", "error_log":"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQUEST_HEADERS \"@contains PHPSESSID\" \"id:1,t:lowercase,t:none,setvar:TX.something=%{REQUEST_HEADERS:Cookie}%\"", "SecRule TX \"@contains to_test\" \"id:2,t:lowercase,t:none\"" @@ -62,16 +62,16 @@ "version_min":300000, "version_max":0, "title":"Testing collection :: TX (with macro) (2/4)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":2313 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "User-Agent":"Mozilla\/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko\/20091102 Firefox\/3.5.5 (.NET CLR 3.5.30729)", "Accept":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8", "Accept-Language":"en-us,en;q=0.5", @@ -88,12 +88,12 @@ "http_version":1.1, "body":"" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Content-Type":"text\/xml; charset=utf-8\n\r", "Content-Length":"length\n\r" }, - "body":[ + "body":[ "\n\r", "\n\r", " \n\r", @@ -104,12 +104,12 @@ "<\/soap:Envelope>\n\r" ] }, - "expected":{ + "expected":{ "audit_log":"", "debug_log":"Target value: \"1\" \\(Variable: TX:somethingPHPSESSID=rAAAAAAA2t5uvjq435r4q7ib3vtdjq120\\)", "error_log":"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQUEST_HEADERS \"@contains PHPSESSID\" \"id:1,t:lowercase,t:none,setvar:TX.something%{REQUEST_HEADERS:Cookie}%\"", "SecRule TX \"@contains to_test\" \"id:2,t:lowercase,t:none\"" @@ -120,16 +120,16 @@ "version_min":300000, "version_max":0, "title":"Testing collection :: TX (with macro) (3/4)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":2313 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "User-Agent":"Mozilla\/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko\/20091102 Firefox\/3.5.5 (.NET CLR 3.5.30729)", "Accept":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8", "Accept-Language":"en-us,en;q=0.5", @@ -146,12 +146,12 @@ "http_version":1.1, "body":"" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Content-Type":"text\/xml; charset=utf-8\n\r", "Content-Length":"length\n\r" }, - "body":[ + "body":[ "\n\r", "\n\r", " \n\r", @@ -162,12 +162,12 @@ "<\/soap:Envelope>\n\r" ] }, - "expected":{ + "expected":{ "audit_log":"", "debug_log":"Target value: \"310\" \\(Variable: TX:something\\)", "error_log":"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQUEST_HEADERS \"@contains PHPSESSID\" \"id:1,t:lowercase,t:none,setvar:TX.something=%{REQUEST_HEADERS:Keep-Alive}%\"", "SecRule REQUEST_HEADERS \"@contains PHPSESSID\" \"id:2,t:lowercase,t:none,setvar:TX.something=+10\"", @@ -179,16 +179,16 @@ "version_min":300000, "version_max":0, "title":"Testing collection :: TX (with macro) (4/4)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":2313 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "User-Agent":"Mozilla\/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko\/20091102 Firefox\/3.5.5 (.NET CLR 3.5.30729)", "Accept":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8", "Accept-Language":"en-us,en;q=0.5", @@ -205,12 +205,12 @@ "http_version":1.1, "body":"" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Content-Type":"text\/xml; charset=utf-8\n\r", "Content-Length":"length\n\r" }, - "body":[ + "body":[ "\n\r", "\n\r", " \n\r", @@ -221,12 +221,12 @@ "<\/soap:Envelope>\n\r" ] }, - "expected":{ + "expected":{ "audit_log":"", "debug_log":"Target value: \"5\" \\(Variable: TX:something_else\\)", "error_log":"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQUEST_HEADERS \"@contains PHPSESSID\" \"id:1,t:lowercase,t:none,setvar:TX.something=+10\"", "SecRule REQUEST_HEADERS \"@contains PHPSESSID\" \"id:2,t:lowercase,t:none,setvar:TX.something_else=%{tx.something}%\"", diff --git a/test/test-cases/regression/collection-tx.json b/test/test-cases/regression/collection-tx.json index 7d2dea3f3e..dc78f5fc3b 100644 --- a/test/test-cases/regression/collection-tx.json +++ b/test/test-cases/regression/collection-tx.json @@ -43,16 +43,16 @@ "version_min":300000, "version_max":0, "title":"Testing collection :: TX (1/4)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":2313 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "User-Agent":"Mozilla\/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko\/20091102 Firefox\/3.5.5 (.NET CLR 3.5.30729)", "Accept":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8", "Accept-Language":"en-us,en;q=0.5", @@ -69,12 +69,12 @@ "http_version":1.1, "body":"" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Content-Type":"text\/xml; charset=utf-8\n\r", "Content-Length":"length\n\r" }, - "body":[ + "body":[ "\n\r", "\n\r", " \n\r", @@ -85,12 +85,12 @@ "<\/soap:Envelope>\n\r" ] }, - "expected":{ + "expected":{ "audit_log":"", "debug_log":"Target value: \"to_test\" \\(Variable: TX:something\\)", "error_log":"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQUEST_HEADERS \"@contains PHPSESSID\" \"id:1,t:lowercase,t:none,setvar:TX.something=to_test\"", "SecRule TX \"@contains to_test\" \"id:2,t:lowercase,t:none\"" @@ -101,16 +101,16 @@ "version_min":300000, "version_max":0, "title":"Testing collection :: TX (2/4)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":2313 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "User-Agent":"Mozilla\/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko\/20091102 Firefox\/3.5.5 (.NET CLR 3.5.30729)", "Accept":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8", "Accept-Language":"en-us,en;q=0.5", @@ -127,12 +127,12 @@ "http_version":1.1, "body":"" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Content-Type":"text\/xml; charset=utf-8\n\r", "Content-Length":"length\n\r" }, - "body":[ + "body":[ "\n\r", "\n\r", " \n\r", @@ -143,12 +143,12 @@ "<\/soap:Envelope>\n\r" ] }, - "expected":{ + "expected":{ "audit_log":"", "debug_log":"Target value: \"1\" \\(Variable: TX:something\\)", "error_log":"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQUEST_HEADERS \"@contains PHPSESSID\" \"id:1,t:lowercase,t:none,setvar:TX.something\"", "SecRule TX \"@contains to_test\" \"id:2,t:lowercase,t:none\"" @@ -159,16 +159,16 @@ "version_min":300000, "version_max":0, "title":"Testing collection :: TX (3/4)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":2313 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "User-Agent":"Mozilla\/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko\/20091102 Firefox\/3.5.5 (.NET CLR 3.5.30729)", "Accept":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8", "Accept-Language":"en-us,en;q=0.5", @@ -185,12 +185,12 @@ "http_version":1.1, "body":"" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Content-Type":"text\/xml; charset=utf-8\n\r", "Content-Length":"length\n\r" }, - "body":[ + "body":[ "\n\r", "\n\r", " \n\r", @@ -201,12 +201,12 @@ "<\/soap:Envelope>\n\r" ] }, - "expected":{ + "expected":{ "audit_log":"", "debug_log":"Target value: \"20\" \\(Variable: TX:something\\)", "error_log":"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQUEST_HEADERS \"@contains PHPSESSID\" \"id:1,t:lowercase,t:none,setvar:TX.something=+10\"", "SecRule REQUEST_HEADERS \"@contains PHPSESSID\" \"id:2,t:lowercase,t:none,setvar:TX.something=+10\"", @@ -218,16 +218,16 @@ "version_min":300000, "version_max":0, "title":"Testing collection :: TX (4/4)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":2313 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "User-Agent":"Mozilla\/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko\/20091102 Firefox\/3.5.5 (.NET CLR 3.5.30729)", "Accept":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8", "Accept-Language":"en-us,en;q=0.5", @@ -244,12 +244,12 @@ "http_version":1.1, "body":"" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Content-Type":"text\/xml; charset=utf-8\n\r", "Content-Length":"length\n\r" }, - "body":[ + "body":[ "\n\r", "\n\r", " \n\r", @@ -260,12 +260,12 @@ "<\/soap:Envelope>\n\r" ] }, - "expected":{ + "expected":{ "audit_log":"", "debug_log":"Target value: \"15\" \\(Variable: TX:something\\)", "error_log":"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQUEST_HEADERS \"@contains PHPSESSID\" \"id:1,t:lowercase,t:none,setvar:TX.something=+10\"", "SecRule REQUEST_HEADERS \"@contains PHPSESSID\" \"id:2,t:lowercase,t:none,setvar:TX.something=+10\"", @@ -278,16 +278,16 @@ "version_min":300000, "version_max":0, "title":"Testing collection :: TX (5/n)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":2313 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "User-Agent":"Mozilla\/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko\/20091102 Firefox\/3.5.5 (.NET CLR 3.5.30729)", "Accept":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8", "Accept-Language":"en-us,en;q=0.5", @@ -305,12 +305,12 @@ "http_version":1.1, "body":"" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Content-Type":"text\/xml; charset=utf-8\n\r", "Content-Length":"length\n\r" }, - "body":[ + "body":[ "\n\r", "\n\r", " \n\r", @@ -321,12 +321,12 @@ "<\/soap:Envelope>\n\r" ] }, - "expected":{ + "expected":{ "audit_log":"", "debug_log":"Target value: \"40\" \\(Variable: TX:anomaly_score\\)", "error_log":"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQUEST_HEADERS:Cookie \"@contains PHPSESSID\" \"id:1,setvar:tx.critical_anomaly_score=5\"", "SecRule REQUEST_HEADERS:Cookie \"@contains PHPSESSID\" \"id:2,setvar:tx.anomaly_score=10\"", diff --git a/test/test-cases/regression/config-body_limits.json b/test/test-cases/regression/config-body_limits.json index 4a48afc5be..8b8b5d2e15 100644 --- a/test/test-cases/regression/config-body_limits.json +++ b/test/test-cases/regression/config-body_limits.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"SecResponseBodyLimitAction Reject", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -20,20 +20,20 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, "expected":{ "http_code":403 }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecResponseBodyLimitAction Reject", "SecResponseBodyLimit 5" @@ -43,16 +43,16 @@ "enabled":1, "version_min":300000, "title":"SecResponseBodyLimitAction ProcessPartial", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -60,20 +60,20 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, "expected":{ "http_code":200 }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecResponseBodyLimitAction ProcessPartial", "SecResponseBodyLimit 5" @@ -83,23 +83,23 @@ "enabled":1, "version_min":300000, "title":"SecRequestBodyLimitAction Reject", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" }, "uri":"/?key=value&key=other_value", "method":"POST", - "body":[ + "body":[ "--------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -117,20 +117,20 @@ "--------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, "expected":{ "http_code":403 }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRequestBodyLimitAction Reject", "SecRequestBodyLimit 5" @@ -140,23 +140,23 @@ "enabled":1, "version_min":300000, "title":"SecRequestBodyLimitAction Reject - Engine Disabled", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" }, "uri":"/?key=value&key=other_value", "method":"POST", - "body":[ + "body":[ "--------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -174,20 +174,20 @@ "--------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, "expected":{ "http_code":200 }, - "rules":[ + "rules":[ "SecRuleEngine Off", "SecRequestBodyLimitAction Reject", "SecRequestBodyLimit 5" @@ -197,23 +197,23 @@ "enabled":1, "version_min":300000, "title":"SecRequestBodyLimitAction Reject - Engine Detection Only", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" }, "uri":"/?key=value&key=other_value", "method":"POST", - "body":[ + "body":[ "--------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -231,20 +231,20 @@ "--------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, "expected":{ "http_code":200 }, - "rules":[ + "rules":[ "SecRuleEngine DetectionOnly", "SecRequestBodyLimitAction Reject", "SecRequestBodyLimit 5" @@ -254,23 +254,23 @@ "enabled":1, "version_min":300000, "title":"SecRequestBodyLimitAction ProcessPartial", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" }, "uri":"/?key=value&key=other_value", "method":"POST", - "body":[ + "body":[ "--------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -288,39 +288,39 @@ "--------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, "expected":{ "http_code":200 }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRequestBodyLimitAction ProcessPartial", "SecRequestBodyLimit 5" ] }, - { + { "enabled":1, "version_min":300000, "title":"SecResponseBodyLimitAction Reject - Engine Disabled", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -328,39 +328,39 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, "expected":{ "http_code":200 }, - "rules":[ + "rules":[ "SecRuleEngine Off", "SecResponseBodyLimitAction Reject", "SecResponseBodyLimit 5" ] }, - { + { "enabled":1, "version_min":300000, "title":"SecResponseBodyLimitAction Reject - Engine Detection Only", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -368,20 +368,20 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, "expected":{ "http_code":200 }, - "rules":[ + "rules":[ "SecRuleEngine DetectionOnly", "SecResponseBodyLimitAction Reject", "SecResponseBodyLimit 5" diff --git a/test/test-cases/regression/issue-1825.json b/test/test-cases/regression/issue-1825.json index 41fc349ff8..40a0c128ed 100644 --- a/test/test-cases/regression/issue-1825.json +++ b/test/test-cases/regression/issue-1825.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"multipart Content-Disposition should allow filename* field (1/7)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -22,7 +22,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -35,32 +35,32 @@ "----------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":"", - "body":"" + "response":{ + "headers":"", + "body":"" }, - "expected":{ + "expected":{ "debug_log":"Target value: \"03CB1664.txt\" \\(Variable: MULTIPART_FILENAME" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule MULTIPART_FILENAME \"@contains 0\" \"id:1,phase:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "title":"multipart Content-Disposition should allow filename* field (2/7)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -70,7 +70,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -83,32 +83,32 @@ "----------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":"", - "body":"" + "response":{ + "headers":"", + "body":"" }, - "expected":{ + "expected":{ "debug_log":"Target value: \"ab0-_xy.txt\" \\(Variable: MULTIPART_FILENAME" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule MULTIPART_FILENAME \"@contains 0\" \"id:1,phase:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "title":"multipart Content-Disposition should allow filename* field (3/7)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -118,7 +118,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -131,32 +131,32 @@ "----------------------------756b6d74fa1a8ee2--\r" ] }, - "response":{ - "headers":"", - "body":"" + "response":{ + "headers":"", + "body":"" }, - "expected":{ + "expected":{ "debug_log":"Warning: no filename= but filename*" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule MULTIPART_FILENAME \"@contains 0\" \"id:1,phase:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "title":"multipart Content-Disposition should allow filename* field (4/7)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -166,7 +166,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -179,32 +179,32 @@ "----------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":"", - "body":"" + "response":{ + "headers":"", + "body":"" }, - "expected":{ + "expected":{ "debug_log":"Multipart: Invalid Content-Disposition header \\(-16" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule MULTIPART_FILENAME \"@contains 0\" \"id:1,phase:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "title":"multipart Content-Disposition should allow filename* field (5/7)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -214,7 +214,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -227,32 +227,32 @@ "----------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":"", - "body":"" + "response":{ + "headers":"", + "body":"" }, - "expected":{ + "expected":{ "debug_log":"Multipart: Invalid Content-Disposition header \\(-17" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule MULTIPART_FILENAME \"@contains 0\" \"id:1,phase:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "title":"multipart Content-Disposition should allow filename* field (6/7)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -262,7 +262,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -275,14 +275,14 @@ "----------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":"", - "body":"" + "response":{ + "headers":"", + "body":"" }, - "expected":{ + "expected":{ "debug_log":"Multipart: Invalid Content-Disposition header \\(-18" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule MULTIPART_FILENAME \"@contains 0\" \"id:1,phase:2,pass,t:trim\"" ] @@ -323,7 +323,7 @@ "----------------------------756b6d74fa1a8ee2--" ] }, - "response":{ + "response":{ "headers":"", "body":"" }, diff --git a/test/test-cases/regression/issue-2099.json b/test/test-cases/regression/issue-2099.json index fff4aa4cc8..ee43f8e56b 100644 --- a/test/test-cases/regression/issue-2099.json +++ b/test/test-cases/regression/issue-2099.json @@ -190,6 +190,6 @@ "SecRule REQUEST_URI \"@contains /test.php\" \"id:100,phase:1,nolog,pass,ctl:ruleRemoveTargetByTag=attack-injection-php;ARGS:a,ctl:ruleRemoveTargetByTag=attack-rce;ARGS:a\"", "SecRule ARGS \"@contains a\" \"id:4400000,tag:'attack-injection-php',phase:2,t:none,msg:'test rule',drop\"" ] - } + } ] diff --git a/test/test-cases/regression/issue-2427.json b/test/test-cases/regression/issue-2427.json index 02f7b16f86..52d2c9e254 100644 --- a/test/test-cases/regression/issue-2427.json +++ b/test/test-cases/regression/issue-2427.json @@ -12,8 +12,8 @@ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -23,7 +23,7 @@ }, "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -72,8 +72,8 @@ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -83,7 +83,7 @@ }, "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", diff --git a/test/test-cases/regression/misc-variable-under-quotes.json b/test/test-cases/regression/misc-variable-under-quotes.json index c455b69dec..91be1eb736 100644 --- a/test/test-cases/regression/misc-variable-under-quotes.json +++ b/test/test-cases/regression/misc-variable-under-quotes.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables (quoted) :: REQUEST_LINE - contains (1/2)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -20,37 +20,37 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"t:lowercase:" }, - "rules":[ + "rules":[ "SecRule \"REQUEST_LINE\" \"@contains index.php/admin/cms/wysiwyg/directive/\" \"id:1,phase:1,t:lowercase,ctl:auditLogParts=+E\"" ] }, - { + { "enabled":1, "version_min":300000, "title":"Testing Variables (quoted) :: REQUEST_LINE - regex (2/2)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -58,20 +58,20 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"t:lowercase:" }, - "rules":[ + "rules":[ "SecRule \"REQUEST_LINE\" \"index.php/admin/cms/wysiwyg/directive/\" \"id:1,t:lowercase,ctl:auditLogParts=+E\"" ] } diff --git a/test/test-cases/regression/offset-variable.json b/test/test-cases/regression/offset-variable.json index 7ffe9299ba..599d7a7d50 100644 --- a/test/test-cases/regression/offset-variable.json +++ b/test/test-cases/regression/offset-variable.json @@ -973,8 +973,8 @@ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -984,7 +984,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -1022,8 +1022,8 @@ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -1033,7 +1033,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -1071,8 +1071,8 @@ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -1082,7 +1082,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -1120,8 +1120,8 @@ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -1131,7 +1131,7 @@ }, "uri":"/wheee/file?something else", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -1169,8 +1169,8 @@ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -1180,7 +1180,7 @@ }, "uri":"/wheee/f%20i%20l%20e%20?something else", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -1218,8 +1218,8 @@ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -1229,7 +1229,7 @@ }, "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -1267,8 +1267,8 @@ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -1278,7 +1278,7 @@ }, "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -1316,8 +1316,8 @@ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -1327,7 +1327,7 @@ }, "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -1369,8 +1369,8 @@ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -1380,7 +1380,7 @@ }, "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -1422,8 +1422,8 @@ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -1433,7 +1433,7 @@ }, "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -1475,8 +1475,8 @@ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -1486,7 +1486,7 @@ }, "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -1528,8 +1528,8 @@ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -1539,7 +1539,7 @@ }, "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -1581,8 +1581,8 @@ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -1592,7 +1592,7 @@ }, "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -1634,8 +1634,8 @@ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -1645,7 +1645,7 @@ }, "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -1687,8 +1687,8 @@ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -1698,7 +1698,7 @@ }, "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -1742,8 +1742,8 @@ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -1753,7 +1753,7 @@ }, "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -1797,8 +1797,8 @@ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -1808,7 +1808,7 @@ }, "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -1852,8 +1852,8 @@ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -1863,7 +1863,7 @@ }, "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -1907,8 +1907,8 @@ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -1918,7 +1918,7 @@ }, "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", diff --git a/test/test-cases/regression/sec_component_signature.json b/test/test-cases/regression/sec_component_signature.json index 580663f629..c3bbe40dd9 100644 --- a/test/test-cases/regression/sec_component_signature.json +++ b/test/test-cases/regression/sec_component_signature.json @@ -1,5 +1,5 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "version_max":0, @@ -38,13 +38,13 @@ "test" ] }, - "expected":{ + "expected":{ "audit_log":"", "debug_log":".*", "error_log":"", "http_code": 403 }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecComponentSignature \"OWASP_CRS/2.2.9\"", "SecRule ARGS \"@contains test\" \"id:1,t:trim,deny,status:403,auditlog\"" diff --git a/test/test-cases/regression/variable-ARGS.json b/test/test-cases/regression/variable-ARGS.json index 1149a2f579..8ca5f67a7a 100644 --- a/test/test-cases/regression/variable-ARGS.json +++ b/test/test-cases/regression/variable-ARGS.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: ARGS - GET (1/7)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -20,38 +20,38 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"other_value\"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule ARGS \"@contains test \" \"id:1,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "title":"Testing Variables :: ARGS - GET (2/7)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -59,20 +59,20 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"value\"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule ARGS \"@contains test \" \"id:1,pass,t:trim\"" ] diff --git a/test/test-cases/regression/variable-ARGS_COMBINED_SIZE.json b/test/test-cases/regression/variable-ARGS_COMBINED_SIZE.json index 034005acea..b908da1634 100644 --- a/test/test-cases/regression/variable-ARGS_COMBINED_SIZE.json +++ b/test/test-cases/regression/variable-ARGS_COMBINED_SIZE.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: ARGS_COMBINED_SIZE - GET (1/7)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -20,38 +20,38 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"22." }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule ARGS_COMBINED_SIZE \"@gt 10 \" \"id:1,pass\"" ] }, - { + { "enabled":1, "version_min":300000, "title":"Testing Variables :: ARGS_COMBINED_SIZE - GET (2/7)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -59,20 +59,20 @@ "uri":"/?key=value&key=other_value&a=b", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"24." }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule ARGS_COMBINED_SIZE \"@gt 10 \" \"id:1,pass\"" ] diff --git a/test/test-cases/regression/variable-ARGS_GET.json b/test/test-cases/regression/variable-ARGS_GET.json index dde6d690ec..26868c66d3 100644 --- a/test/test-cases/regression/variable-ARGS_GET.json +++ b/test/test-cases/regression/variable-ARGS_GET.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: ARGS_GET (1/6)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -20,20 +20,20 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"other_value\"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule ARGS_GET \"@contains test \" \"id:1,pass,t:trim\"" ] @@ -42,16 +42,16 @@ "enabled":1, "version_min":300000, "title":"Testing Variables :: ARGS_GET (2/6)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -59,20 +59,20 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"value\"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule ARGS_GET \"@contains test \" \"id:1,pass,t:trim\"" ] @@ -81,16 +81,16 @@ "enabled":1, "version_min":300000, "title":"Testing Variables :: ARGS_GET (3/6)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -98,20 +98,20 @@ "uri":"/?key=value&key=other_value%26withsomestuff=tootherstuff", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"other_value&withsomestuff=tootherstuff\"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule ARGS_GET \"@contains test \" \"id:1,pass,t:trim\"" ] @@ -120,16 +120,16 @@ "enabled":1, "version_min":300000, "title":"Testing Variables :: ARGS_GET (4/6)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -137,20 +137,20 @@ "uri":"/?key=value&secondkey=&key3=val3", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"0\"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule ARGS_GET:secondkey \"0\" \"id:1,phase:2,pass,t:none,t:length\"" ] @@ -159,16 +159,16 @@ "enabled":1, "version_min":300000, "title":"Testing Variables :: ARGS_GET (5/6)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -176,20 +176,20 @@ "uri":"/?key=value&secondkey=othervalue&", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"othervalue\"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule ARGS_GET \"@rx ^othervalue$ \" \"id:1,pass,t:none\"" ] diff --git a/test/test-cases/regression/variable-ARGS_GET_NAMES.json b/test/test-cases/regression/variable-ARGS_GET_NAMES.json index be1e03d0c5..945394b6cc 100644 --- a/test/test-cases/regression/variable-ARGS_GET_NAMES.json +++ b/test/test-cases/regression/variable-ARGS_GET_NAMES.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: ARGS_GET_NAMES (1/2)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -20,38 +20,38 @@ "uri":"/?key1=value&key2=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"key1\"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule ARGS_GET_NAMES \"@contains test \" \"id:1,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "title":"Testing Variables :: ARGS_GET_NAMES (2/2)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -59,20 +59,20 @@ "uri":"/?key1=value&key2=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"key2\"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule ARGS_GET_NAMES \"@contains test \" \"id:1,pass,t:trim\"" ] diff --git a/test/test-cases/regression/variable-ARGS_NAMES.json b/test/test-cases/regression/variable-ARGS_NAMES.json index bf3e80d427..e11623b9e1 100644 --- a/test/test-cases/regression/variable-ARGS_NAMES.json +++ b/test/test-cases/regression/variable-ARGS_NAMES.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: ARGS_NAMES - GET (1/4)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -20,38 +20,38 @@ "uri":"/?key1=value&key2=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"key1\"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule ARGS_NAMES \"@contains test \" \"id:1,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "title":"Testing Variables :: ARGS_NAMES - GET (2/4)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -59,20 +59,20 @@ "uri":"/?key1=value&key2=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"key2\"" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule ARGS_NAMES \"@contains test \" \"id:1,pass,t:trim\"" ] diff --git a/test/test-cases/regression/variable-ARGS_POST.json b/test/test-cases/regression/variable-ARGS_POST.json index 4b9972cadf..7cc701364e 100644 --- a/test/test-cases/regression/variable-ARGS_POST.json +++ b/test/test-cases/regression/variable-ARGS_POST.json @@ -1,4 +1,4 @@ -[ +[ { "enabled":1, "version_min":300000, diff --git a/test/test-cases/regression/variable-FILES.json b/test/test-cases/regression/variable-FILES.json index 7f0f4dcf56..30a2c5ef7a 100644 --- a/test/test-cases/regression/variable-FILES.json +++ b/test/test-cases/regression/variable-FILES.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: FILES (1/2)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -22,7 +22,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -40,20 +40,20 @@ "----------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"T \\(0\\) t:trim: \"small_text_file" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule FILES \"@contains small_text_file.txt\" \"id:1,phase:3,pass,t:trim\"" ] diff --git a/test/test-cases/regression/variable-FILES_COMBINED_SIZE.json b/test/test-cases/regression/variable-FILES_COMBINED_SIZE.json index 23a1c027ee..4f585bea2e 100644 --- a/test/test-cases/regression/variable-FILES_COMBINED_SIZE.json +++ b/test/test-cases/regression/variable-FILES_COMBINED_SIZE.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: FILES_NAMES (1/1)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -22,7 +22,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -40,20 +40,20 @@ "----------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"70\" \\(Variable: FILES_COMBINED_SIZE\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule FILES_COMBINED_SIZE \"@gt 70\" \"id:1,phase:3,pass,t:trim\"" ] diff --git a/test/test-cases/regression/variable-FILES_NAMES.json b/test/test-cases/regression/variable-FILES_NAMES.json index fcf95ed972..6506c611d1 100644 --- a/test/test-cases/regression/variable-FILES_NAMES.json +++ b/test/test-cases/regression/variable-FILES_NAMES.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: FILES_NAMES (1/1)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -22,7 +22,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -40,20 +40,20 @@ "----------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"T \\(0\\) t:trim: \"filedata" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule FILES_NAMES \"@contains filedata\" \"id:1,phase:3,pass,t:trim\"" ] diff --git a/test/test-cases/regression/variable-FILES_SIZES.json b/test/test-cases/regression/variable-FILES_SIZES.json index fa8a3525c7..8dd05020dd 100644 --- a/test/test-cases/regression/variable-FILES_SIZES.json +++ b/test/test-cases/regression/variable-FILES_SIZES.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: FILES_NAMES (1/1)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -22,7 +22,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -40,20 +40,20 @@ "----------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"38\" \\(Variable: FILES_SIZES:filedata\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule FILES_SIZES \"@gt 70.000000\" \"id:1,phase:3,pass,t:trim\"" ] diff --git a/test/test-cases/regression/variable-FULL_REQUEST.json b/test/test-cases/regression/variable-FULL_REQUEST.json index c1fd971125..b314827b52 100644 --- a/test/test-cases/regression/variable-FULL_REQUEST.json +++ b/test/test-cases/regression/variable-FULL_REQUEST.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: FULL_REQUEST (1/1)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -22,7 +22,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "--------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -40,20 +40,20 @@ "--------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Multipart: Boundary: --------------------------756b6d74fa1a8ee2" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRequestBodyAccess On", "SecRule FULL_REQUEST \"@contains small_text_file.txt\" \"id:1,phase:3,pass,t:trim\"" diff --git a/test/test-cases/regression/variable-FULL_REQUEST_LENGTH.json b/test/test-cases/regression/variable-FULL_REQUEST_LENGTH.json index 9bba74d466..42465ed1aa 100644 --- a/test/test-cases/regression/variable-FULL_REQUEST_LENGTH.json +++ b/test/test-cases/regression/variable-FULL_REQUEST_LENGTH.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: FULL_REQUEST_LENGTH (1/1)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -22,7 +22,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "--------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -40,20 +40,20 @@ "--------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"690\" \\(Variable: FULL_REQUEST_LENGTH\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRequestBodyAccess On", "SecRule FULL_REQUEST_LENGTH \"@contains small_text_file.txt\" \"id:1,phase:3,pass,t:trim\"" diff --git a/test/test-cases/regression/variable-GEO.json b/test/test-cases/regression/variable-GEO.json index d304e13ab4..be530f5e59 100644 --- a/test/test-cases/regression/variable-GEO.json +++ b/test/test-cases/regression/variable-GEO.json @@ -1,19 +1,19 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "resource":"geoip", "title":"Testing Variables :: GEO:LONGITUDE [GeoIP]", - "client":{ + "client":{ "ip":"64.17.254.216", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -21,41 +21,41 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"-118.403999\" \\(Variable: GEO:LONGITUDE\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecGeoLookupDb test-cases\/data\/geo\/GeoIPCity.dat", "SecRule REMOTE_ADDR \"@geoLookup\" \"id:1,pass,t:trim\"", "SecRule GEO \"@contains test \" \"id:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "resource":"maxmind", "title":"Testing Variables :: GEO:COUNTRY_NAME [maxmind]", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -63,41 +63,41 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"Brazil\" \\(Variable: GEO:COUNTRY_NAME\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecGeoLookupDb test-cases\/data\/GeoIP2-City-Test.mmdb", "SecRule REMOTE_ADDR \"@geoLookup\" \"id:1,pass,t:trim\"", "SecRule GEO \"@contains test \" \"id:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "resource":"geoip", "title":"Testing Variables :: GEO:LATITUDE [GeoIP]", - "client":{ + "client":{ "ip":"64.17.254.216", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -105,41 +105,41 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"33.916401\" \\(Variable: GEO:LATITUDE\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecGeoLookupDb test-cases\/data\/geo\/GeoIPCity.dat", "SecRule REMOTE_ADDR \"@geoLookup\" \"id:1,pass,t:trim\"", "SecRule GEO \"@contains test \" \"id:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "resource":"geoip", "title":"Testing Variables :: GEO:COUNTRY_CODE3 [GeoIP]", - "client":{ + "client":{ "ip":"64.17.254.216", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -147,41 +147,41 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"USA\" \\(Variable: GEO:COUNTRY_CODE3\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecGeoLookupDb test-cases\/data\/geo\/GeoIPCity.dat", "SecRule REMOTE_ADDR \"@geoLookup\" \"id:1,pass,t:trim\"", "SecRule GEO \"@contains test \" \"id:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "resource":"geoip", "title":"Testing Variables :: GEO:COUNTRY_CODE [GeoIP]", - "client":{ + "client":{ "ip":"64.17.254.216", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -189,41 +189,41 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"US\" \\(Variable: GEO:COUNTRY_CODE\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecGeoLookupDb test-cases\/data\/geo\/GeoIPCity.dat", "SecRule REMOTE_ADDR \"@geoLookup\" \"id:1,pass,t:trim\"", "SecRule GEO \"@contains test \" \"id:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "resource":"geoip", "title":"Testing Variables :: GEO:COUNTRY_CONTINENT [GeoIP]", - "client":{ + "client":{ "ip":"64.17.254.216", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -231,41 +231,41 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"NA\" \\(Variable: GEO:COUNTRY_CONTINENT\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecGeoLookupDb test-cases\/data\/geo\/GeoIPCity.dat", "SecRule REMOTE_ADDR \"@geoLookup\" \"id:1,pass,t:trim\"", "SecRule GEO \"@contains test \" \"id:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "resource":"geoip", "title":"Testing Variables :: GEO:AREA_CODE [GeoIP]", - "client":{ + "client":{ "ip":"64.17.254.216", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -273,41 +273,41 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"310\" \\(Variable: GEO:AREA_CODE\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecGeoLookupDb test-cases\/data\/geo\/GeoIPCity.dat", "SecRule REMOTE_ADDR \"@geoLookup\" \"id:1,pass,t:trim\"", "SecRule GEO \"@contains test \" \"id:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "resource":"geoip", "title":"Testing Variables :: GEO:DMA_CODE [GeoIP]", - "client":{ + "client":{ "ip":"64.17.254.216", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -315,41 +315,41 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"803\" \\(Variable: GEO:DMA_CODE\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecGeoLookupDb test-cases\/data\/geo\/GeoIPCity.dat", "SecRule REMOTE_ADDR \"@geoLookup\" \"id:1,pass,t:trim\"", "SecRule GEO \"@contains test \" \"id:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "resource":"geoip", "title":"Testing Variables :: GEO:POSTAL_CODE [GeoIP]", - "client":{ + "client":{ "ip":"64.17.254.216", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -357,41 +357,41 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"90245\" \\(Variable: GEO:POSTAL_CODE\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecGeoLookupDb test-cases\/data\/geo\/GeoIPCity.dat", "SecRule REMOTE_ADDR \"@geoLookup\" \"id:1,pass,t:trim\"", "SecRule GEO \"@contains test \" \"id:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "resource":"geoip", "title":"Testing Variables :: GEO:REGION [GeoIP]", - "client":{ + "client":{ "ip":"64.17.254.216", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -399,41 +399,41 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"California\" \\(Variable: GEO:REGION\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecGeoLookupDb test-cases\/data\/geo\/GeoIPCity.dat", "SecRule REMOTE_ADDR \"@geoLookup\" \"id:1,pass,t:trim\"", "SecRule GEO \"@contains test \" \"id:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "resource":"geoip", "title":"Testing Variables :: GEO:CITY [GeoIP]", - "client":{ + "client":{ "ip":"64.17.254.216", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -441,41 +441,41 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"El Segundo\" \\(Variable: GEO:CITY\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecGeoLookupDb test-cases\/data\/geo\/GeoIPCity.dat", "SecRule REMOTE_ADDR \"@geoLookup\" \"id:1,pass,t:trim\"", "SecRule GEO \"@contains test \" \"id:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "resource":"geoip", "title":"Testing Variables :: GEO:LONGITUDE [GeoIP]", - "client":{ + "client":{ "ip":"64.17.254.216", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -483,41 +483,41 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"-118.403999\" \\(Variable: GEO:LONGITUDE\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecGeoLookupDb test-cases\/data\/geo\/GeoIPCity.dat", "SecRule REMOTE_ADDR \"@geoLookup\" \"id:1,pass,t:trim\"", "SecRule GEO \"@contains test \" \"id:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "resource":"maxmind", "title":"Testing Variables :: GEO:COUNTRY_NAME [maxmind]", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -525,41 +525,41 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"Brazil\" \\(Variable: GEO:COUNTRY_NAME\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecGeoLookupDb test-cases\/data\/GeoIP2-City-Test.mmdb", "SecRule REMOTE_ADDR \"@geoLookup\" \"id:1,pass,t:trim\"", "SecRule GEO \"@contains test \" \"id:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "resource":"maxmind", "title":"Testing Variables :: GEO:LATITUDE [maxmind]", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -567,41 +567,41 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"-8.051502\" \\(Variable: GEO:LATITUDE\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecGeoLookupDb test-cases\/data\/GeoIP2-City-Test.mmdb", "SecRule REMOTE_ADDR \"@geoLookup\" \"id:1,pass,t:trim\"", "SecRule GEO \"@contains test \" \"id:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "resource":"maxmind", "title":"Testing Variables :: GEO:COUNTRY_CODE [maxmind]", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -609,41 +609,41 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"BR\" \\(Variable: GEO:COUNTRY_CODE\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecGeoLookupDb test-cases\/data\/GeoIP2-City-Test.mmdb", "SecRule REMOTE_ADDR \"@geoLookup\" \"id:1,pass,t:trim\"", "SecRule GEO \"@contains test \" \"id:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "resource":"maxmind", "title":"Testing Variables :: GEO:COUNTRY_CONTINENT [maxmind]", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -651,41 +651,41 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"South America\" \\(Variable: GEO:COUNTRY_CONTINENT\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecGeoLookupDb test-cases\/data\/GeoIP2-City-Test.mmdb", "SecRule REMOTE_ADDR \"@geoLookup\" \"id:1,pass,t:trim\"", "SecRule GEO \"@contains test \" \"id:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "resource":"maxmind", "title":"Testing Variables :: GEO:POSTAL_CODE [maxmind]", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -693,41 +693,41 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"50040090\" \\(Variable: GEO:POSTAL_CODE\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecGeoLookupDb test-cases\/data\/GeoIP2-City-Test.mmdb", "SecRule REMOTE_ADDR \"@geoLookup\" \"id:1,pass,t:trim\"", "SecRule GEO \"@contains test \" \"id:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "resource":"maxmind", "title":"Testing Variables :: GEO:CITY [maxmind]", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -735,20 +735,20 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"Recife\" \\(Variable: GEO:CITY\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecGeoLookupDb test-cases\/data\/GeoIP2-City-Test.mmdb", "SecRule REMOTE_ADDR \"@geoLookup\" \"id:1,pass,t:trim\"", diff --git a/test/test-cases/regression/variable-HIGHEST_SEVERITY.json b/test/test-cases/regression/variable-HIGHEST_SEVERITY.json index 7da62133f9..82b0390f3a 100644 --- a/test/test-cases/regression/variable-HIGHEST_SEVERITY.json +++ b/test/test-cases/regression/variable-HIGHEST_SEVERITY.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: HIGHEST_SEVERITY (1/2)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -20,39 +20,39 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"0\" \\(Variable: HIGHEST_SEVERITY\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REMOTE_ADDR \"@contains 200.249\" \"id:1,pass,t:trim,severity:0\"", "SecRule HIGHEST_SEVERITY \"@lt 10\" \"id:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "title":"Testing Variables :: HIGHEST_SEVERITY (2/2)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -60,20 +60,20 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"0\" \\(Variable: HIGHEST_SEVERITY\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REMOTE_ADDR \"@contains 200.249\" \"id:1,pass,t:trim,severity:EMERGENCY\"", "SecRule HIGHEST_SEVERITY \"@lt 10\" \"id:2,pass,t:trim\"" diff --git a/test/test-cases/regression/variable-INBOUND_DATA_ERROR.json b/test/test-cases/regression/variable-INBOUND_DATA_ERROR.json index e66a1647b8..3b2f62c44e 100644 --- a/test/test-cases/regression/variable-INBOUND_DATA_ERROR.json +++ b/test/test-cases/regression/variable-INBOUND_DATA_ERROR.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: INBOUND_DATA_ERROR (1/2)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -20,38 +20,38 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"0\" \\(Variable: INBOUND_DATA_ERROR\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule INBOUND_DATA_ERROR \"@eq 1\" \"id:1,phase:3,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "title":"Testing Variables :: INBOUND_DATA_ERROR (1/1)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -61,7 +61,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "--------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -79,20 +79,20 @@ "--------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"1\" \\(Variable: INBOUND_DATA_ERROR\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRequestBodyLimit 2", "SecRule INBOUND_DATA_ERROR \"@eq 1\" \"id:1,phase:3,pass,t:trim\"" diff --git a/test/test-cases/regression/variable-MULTIPART_STRICT_ERROR.json b/test/test-cases/regression/variable-MULTIPART_STRICT_ERROR.json index 402e4541dc..b789b47688 100644 --- a/test/test-cases/regression/variable-MULTIPART_STRICT_ERROR.json +++ b/test/test-cases/regression/variable-MULTIPART_STRICT_ERROR.json @@ -22,7 +22,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "--------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -81,7 +81,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "--------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -140,7 +140,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "--------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -199,7 +199,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "----------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -258,7 +258,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "--------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", diff --git a/test/test-cases/regression/variable-MULTIPART_UNMATCHED_BOUNDARY.json b/test/test-cases/regression/variable-MULTIPART_UNMATCHED_BOUNDARY.json index 97b34d5552..cb0000318a 100644 --- a/test/test-cases/regression/variable-MULTIPART_UNMATCHED_BOUNDARY.json +++ b/test/test-cases/regression/variable-MULTIPART_UNMATCHED_BOUNDARY.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: MULTIPART_UNMATCHED_BOUNDARY", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -22,7 +22,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "--------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -40,20 +40,20 @@ "" ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"1\" \\(Variable: MULTIPART_UNMATCHED_BOUNDARY\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule MULTIPART_UNMATCHED_BOUNDARY \"@contains small_text_file.txt\" \"id:1,phase:3,pass,t:trim\"" ] diff --git a/test/test-cases/regression/variable-OUTBOUND_DATA_ERROR.json b/test/test-cases/regression/variable-OUTBOUND_DATA_ERROR.json index 93651239e7..f043df00ea 100644 --- a/test/test-cases/regression/variable-OUTBOUND_DATA_ERROR.json +++ b/test/test-cases/regression/variable-OUTBOUND_DATA_ERROR.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: OUTBOUND_DATA_ERROR (1/2)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -20,39 +20,39 @@ "uri":"/?key=value&key=other_value", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"0\" \\(Variable: OUTBOUND_DATA_ERROR\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecResponseBodyAccess On", "SecRule OUTBOUND_DATA_ERROR \"@eq 1\" \"id:1,phase:4,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "title":"Testing Variables :: OUTBOUND_DATA_ERROR (2/2)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -62,7 +62,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "--------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -80,13 +80,13 @@ "--------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "--------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -104,10 +104,10 @@ "--------------------------756b6d74fa1a8ee2--" ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"1\" \\(Variable: OUTBOUND_DATA_ERROR\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecResponseBodyAccess On", "SecResponseBodyLimit 2", diff --git a/test/test-cases/regression/variable-REQBODY_PROCESSOR.json b/test/test-cases/regression/variable-REQBODY_PROCESSOR.json index db7bf184f6..ca05a938bf 100644 --- a/test/test-cases/regression/variable-REQBODY_PROCESSOR.json +++ b/test/test-cases/regression/variable-REQBODY_PROCESSOR.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: REQBODY_PROCESSOR (1/3)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -58,39 +58,39 @@ "" ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"XML\" \\(Variable: REQBODY_PROCESSOR\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQUEST_HEADERS:Content-Type \"^(?:application(?:/soap\\+|/)|text/)xml\" \"id:500005,phase:1,t:none,t:lowercase,nolog,pass,ctl:requestBodyProcessor=XML\"", "SecRule REQBODY_PROCESSOR \"@contains test\" \"id:1,pass,phase:2,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "title":"Testing Variables :: REQBODY_PROCESSOR (2/3)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -117,38 +117,38 @@ "--------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"MULTIPART\" \\(Variable: REQBODY_PROCESSOR\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQBODY_PROCESSOR \"@contains test\" \"id:1,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "title":"Testing Variables :: REQBODY_PROCESSOR (3/3)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -161,20 +161,20 @@ "param1=value1¶m2=value2" ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"URLENCODED\" \\(Variable: REQBODY_PROCESSOR\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQBODY_PROCESSOR \"@contains test\" \"id:1,pass,t:trim\"" ] diff --git a/test/test-cases/regression/variable-REQBODY_PROCESSOR_ERROR.json b/test/test-cases/regression/variable-REQBODY_PROCESSOR_ERROR.json index 029a65bd08..fb1d937610 100644 --- a/test/test-cases/regression/variable-REQBODY_PROCESSOR_ERROR.json +++ b/test/test-cases/regression/variable-REQBODY_PROCESSOR_ERROR.json @@ -1,19 +1,19 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "resource":"libxml2", "title":"Testing Variables :: REQBODY_PROCESSOR_ERROR_MSG (1/2)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -59,40 +59,40 @@ "" ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"XML parsing error: XML: Failed to parse document" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQUEST_HEADERS:Content-Type \"^text/xml$\" \"id:500005,phase:1,t:none,t:lowercase,nolog,pass,ctl:requestBodyProcessor=XML\"", "SecRule REQBODY_PROCESSOR_ERROR \"@contains test\" \"phase:2,id:1,pass,t:trim\"", "SecRule REQBODY_PROCESSOR_ERROR_MSG \"@contains test\" \"phase:2,id:2,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "title":"Testing Variables :: REQBODY_PROCESSOR_ERROR_MSG (2/2)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -118,20 +118,20 @@ "This is another very small test file.." ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Multipart parsing error: Multipart: Final boundary missing." }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQUEST_HEADERS:Content-Type \"^text/xml$\" \"id:500005,phase:1,t:none,t:lowercase,nolog,pass,ctl:requestBodyProcessor=XML\"", "SecRule REQBODY_PROCESSOR_ERROR \"@contains test\" \"phase:2,id:1,pass,t:trim\"", diff --git a/test/test-cases/regression/variable-REQUEST_BODY.json b/test/test-cases/regression/variable-REQUEST_BODY.json index 34206c35af..296f8a25ec 100644 --- a/test/test-cases/regression/variable-REQUEST_BODY.json +++ b/test/test-cases/regression/variable-REQUEST_BODY.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: REQUEST_BODY", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -22,7 +22,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "--------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -40,20 +40,20 @@ "--------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"--------------------------756b6d74fa1a8ee2\\x0aContent-Disposition: form-data; na" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRequestBodyAccess On", "SecRule REQUEST_BODY \"@contains small_text_file.txt\" \"id:1,phase:3,pass,t:trim\"" diff --git a/test/test-cases/regression/variable-REQUEST_BODY_LENGTH.json b/test/test-cases/regression/variable-REQUEST_BODY_LENGTH.json index 2515eb55fc..b509ee89c1 100644 --- a/test/test-cases/regression/variable-REQUEST_BODY_LENGTH.json +++ b/test/test-cases/regression/variable-REQUEST_BODY_LENGTH.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: REQUEST_BODY_LENGTH", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -22,7 +22,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "--------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -40,20 +40,20 @@ "--------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"508\" \\(Variable: REQUEST_BODY_LENGTH\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRequestBodyAccess On", "SecRule REQUEST_BODY_LENGTH \"@contains small_text_file.txt\" \"id:1,phase:3,pass,t:trim\"" diff --git a/test/test-cases/regression/variable-REQUEST_HEADERS.json b/test/test-cases/regression/variable-REQUEST_HEADERS.json index 3e34bc6de1..d7145fb043 100644 --- a/test/test-cases/regression/variable-REQUEST_HEADERS.json +++ b/test/test-cases/regression/variable-REQUEST_HEADERS.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: REQUEST_HEADERS", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -22,7 +22,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "--------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -40,20 +40,20 @@ "--------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"localhost\" \\(Variable: REQUEST_HEADERS:Host\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQUEST_HEADERS \"@contains small_text_file.txt\" \"id:1,phase:3,pass,t:trim\"" ] diff --git a/test/test-cases/regression/variable-REQUEST_LINE.json b/test/test-cases/regression/variable-REQUEST_LINE.json index 586f0c312f..61b4ec0e17 100644 --- a/test/test-cases/regression/variable-REQUEST_LINE.json +++ b/test/test-cases/regression/variable-REQUEST_LINE.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: REQUEST_LINE", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -21,20 +21,20 @@ "method":"GET", "http_version":1.1 }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"GET /\\?key=value\\&key=other_value HTTP/1.1\" \\(Variable: REQUEST_LINE\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQUEST_LINE \"@contains test \" \"id:1,pass,t:trim\"" ] diff --git a/test/test-cases/regression/variable-REQUEST_METHOD.json b/test/test-cases/regression/variable-REQUEST_METHOD.json index 2a9b609b17..f054b41b8c 100644 --- a/test/test-cases/regression/variable-REQUEST_METHOD.json +++ b/test/test-cases/regression/variable-REQUEST_METHOD.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: REQUEST_METHOD", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -21,20 +21,20 @@ "method":"GET", "http_version":1.1 }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"GET\" \\(Variable: REQUEST_METHOD\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQUEST_METHOD \"@contains test \" \"id:1,pass,t:trim\"" ] diff --git a/test/test-cases/regression/variable-REQUEST_PROTOCOL.json b/test/test-cases/regression/variable-REQUEST_PROTOCOL.json index e5a53de7b9..7e72efd2c4 100644 --- a/test/test-cases/regression/variable-REQUEST_PROTOCOL.json +++ b/test/test-cases/regression/variable-REQUEST_PROTOCOL.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: REQUEST_PROTOCOL", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -21,20 +21,20 @@ "method":"GET", "http_version":1.1 }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"HTTP/1.1\" \\(Variable: REQUEST_PROTOCOL\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQUEST_PROTOCOL \"@contains test \" \"id:1,pass,t:trim\"" ] diff --git a/test/test-cases/regression/variable-REQUEST_URI.json b/test/test-cases/regression/variable-REQUEST_URI.json index 795ce29b6c..f8b772d9d8 100644 --- a/test/test-cases/regression/variable-REQUEST_URI.json +++ b/test/test-cases/regression/variable-REQUEST_URI.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: REQUEST_URI", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -21,20 +21,20 @@ "method":"GET", "http_version":1.1 }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"/\\?key=value\\&key=other_value\" \\(Variable: REQUEST_URI\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQUEST_URI \"@contains test \" \"id:1,pass,t:trim\"" ] diff --git a/test/test-cases/regression/variable-REQUEST_URI_RAW.json b/test/test-cases/regression/variable-REQUEST_URI_RAW.json index 09fff33cd3..645b486461 100644 --- a/test/test-cases/regression/variable-REQUEST_URI_RAW.json +++ b/test/test-cases/regression/variable-REQUEST_URI_RAW.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: REQUEST_URI_RAW", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -21,20 +21,20 @@ "method":"GET", "http_version":1.1 }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"/\\?key=value\\&key=other_value\" \\(Variable: REQUEST_URI_RAW\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQUEST_URI_RAW \"@contains test \" \"id:1,pass,t:trim\"" ] diff --git a/test/test-cases/regression/variable-RESPONSE_CONTENT_LENGTH.json b/test/test-cases/regression/variable-RESPONSE_CONTENT_LENGTH.json index f71bc707c7..d65aa55e7f 100644 --- a/test/test-cases/regression/variable-RESPONSE_CONTENT_LENGTH.json +++ b/test/test-cases/regression/variable-RESPONSE_CONTENT_LENGTH.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: RESPONSE_CONTENT_LENGTH", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -21,20 +21,20 @@ "method":"GET", "http_version":1.1 }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"9\" \\(Variable: RESPONSE_CONTENT_LENGTH\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecResponseBodyAccess On", "SecRule RESPONSE_CONTENT_LENGTH \"@contains test \" \"id:1,phase:4,pass,t:trim\"" diff --git a/test/test-cases/regression/variable-RESPONSE_CONTENT_TYPE.json b/test/test-cases/regression/variable-RESPONSE_CONTENT_TYPE.json index 704d20400a..a3d6ca92ef 100644 --- a/test/test-cases/regression/variable-RESPONSE_CONTENT_TYPE.json +++ b/test/test-cases/regression/variable-RESPONSE_CONTENT_TYPE.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: RESPONSE_CONTENT_TYPE", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -21,20 +21,20 @@ "method":"GET", "http_version":1.1 }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"text/html\" \\(Variable: RESPONSE_CONTENT_TYPE\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule RESPONSE_CONTENT_TYPE \"@contains test \" \"id:1,phase:3,pass,t:trim\"" ] diff --git a/test/test-cases/regression/variable-RESPONSE_HEADERS.json b/test/test-cases/regression/variable-RESPONSE_HEADERS.json index dd0c3d7487..74cf069f14 100644 --- a/test/test-cases/regression/variable-RESPONSE_HEADERS.json +++ b/test/test-cases/regression/variable-RESPONSE_HEADERS.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: RESPONSE_HEADERS", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*", @@ -22,7 +22,7 @@ }, "uri":"/", "method":"POST", - "body":[ + "body":[ "--------------------------756b6d74fa1a8ee2", "Content-Disposition: form-data; name=\"name\"", "", @@ -40,20 +40,20 @@ "--------------------------756b6d74fa1a8ee2--" ] }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"Mon, 13 Jul 2015 20:02:41 GMT\" \\(Variable: RESPONSE_HEADERS:Date\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule RESPONSE_HEADERS \"@contains small_text_file.txt\" \"id:1,phase:3,pass,t:trim\"" ] diff --git a/test/test-cases/regression/variable-RESPONSE_PROTOCOL.json b/test/test-cases/regression/variable-RESPONSE_PROTOCOL.json index a54c16c0b5..f00fa9e2d8 100644 --- a/test/test-cases/regression/variable-RESPONSE_PROTOCOL.json +++ b/test/test-cases/regression/variable-RESPONSE_PROTOCOL.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: RESPONSE_PROTOCOL", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -21,21 +21,21 @@ "method":"GET", "http_version":1.1 }, - "response":{ + "response":{ "protocol": "HTTP/1.1", - "headers":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"HTTP/1.1\" \\(Variable: RESPONSE_PROTOCOL\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule RESPONSE_PROTOCOL \"^HTTP\" \"id:1,phase:5,pass,t:trim\"" ] diff --git a/test/test-cases/regression/variable-SERVER_NAME.json b/test/test-cases/regression/variable-SERVER_NAME.json index e0fd6c105e..460597a864 100644 --- a/test/test-cases/regression/variable-SERVER_NAME.json +++ b/test/test-cases/regression/variable-SERVER_NAME.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: SERVER_NAME (1/2)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -21,39 +21,39 @@ "method":"GET", "http_version":1.1 }, - "response":{ + "response":{ "protocol": "HTTP/1.1", - "headers":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"localhost\" \\(Variable: SERVER_NAME\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule SERVER_NAME \"^HTTP\" \"id:1,phase:5,pass,t:trim\"" ] }, - { + { "enabled":1, "version_min":300000, "title":"Testing Variables :: SERVER_NAME (2/2)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"www.zimmerle.org:4443", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -62,21 +62,21 @@ "method":"GET", "http_version":1.1 }, - "response":{ + "response":{ "protocol": "HTTP/1.1", - "headers":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"www.zimmerle.org\" \\(Variable: SERVER_NAME\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule SERVER_NAME \"^HTTP\" \"id:1,phase:5,pass,t:trim\"" ] diff --git a/test/test-cases/regression/variable-URLENCODED_ERROR.json b/test/test-cases/regression/variable-URLENCODED_ERROR.json index 060df0b45b..793d8bc366 100644 --- a/test/test-cases/regression/variable-URLENCODED_ERROR.json +++ b/test/test-cases/regression/variable-URLENCODED_ERROR.json @@ -1,18 +1,18 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "title":"Testing Variables :: URLENCODED_ERROR - GET (1/7)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -20,38 +20,38 @@ "uri":"/?key=value&key=other_value%2", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"1\" \\(Variable: URLENCODED_ERROR\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule URLENCODED_ERROR \"@gt 10 \" \"id:1,pass\"" ] }, - { + { "enabled":1, "version_min":300000, "title":"Testing Variables :: URLENCODED_ERROR - GET (2/7)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":123 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", "Accept":"*/*" @@ -59,20 +59,20 @@ "uri":"/?key=value&key=other_value&a=b%2a", "method":"GET" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Date":"Mon, 13 Jul 2015 20:02:41 GMT", "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", "Content-Type":"text/html" }, - "body":[ + "body":[ "no need." ] }, - "expected":{ + "expected":{ "debug_log":"Target value: \"0\" \\(Variable: URLENCODED_ERROR\\)" }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule URLENCODED_ERROR \"@gt 10 \" \"id:1,pass\"" ] diff --git a/test/test-cases/regression/variable-variation-exclusion.json b/test/test-cases/regression/variable-variation-exclusion.json index 91098b1a8f..e6b2915bd0 100644 --- a/test/test-cases/regression/variable-variation-exclusion.json +++ b/test/test-cases/regression/variable-variation-exclusion.json @@ -1,19 +1,19 @@ -[ - { +[ + { "enabled":1, "version_min":300000, "version_max":0, "title":"Testing variable variations :: exclusion (1/2)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":2313 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "User-Agent":"Mozilla\/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko\/20091102 Firefox\/3.5.5 (.NET CLR 3.5.30729)", "Accept":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8", "Accept-Language":"en-us,en;q=0.5", @@ -30,12 +30,12 @@ "http_version":1.1, "body":"" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Content-Type":"text\/xml; charset=utf-8\n\r", "Content-Length":"length\n\r" }, - "body":[ + "body":[ "\n\r", "\n\r", " \n\r", @@ -46,32 +46,32 @@ "<\/soap:Envelope>\n\r" ] }, - "expected":{ + "expected":{ "audit_log":"", "debug_log":"", "error_log":"", "http_code":200 }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQUEST_HEADERS|!REQUEST_HEADERS:Accept|!REMOTE_HOST \"@contains html\" \"id:1,t:lowercase,t:none,block,deny,status:300\"" ] }, - { + { "enabled":1, "version_min":300000, "version_max":0, "title":"Testing variable variations :: exclusion (2/2)", - "client":{ + "client":{ "ip":"200.249.12.31", "port":2313 }, - "server":{ + "server":{ "ip":"200.249.12.31", "port":80 }, - "request":{ - "headers":{ + "request":{ + "headers":{ "User-Agent":"Mozilla\/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko\/20091102 Firefox\/3.5.5 (.NET CLR 3.5.30729)", "Accept":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8", "Accept-Language":"en-us,en;q=0.5", @@ -88,12 +88,12 @@ "http_version":1.1, "body":"" }, - "response":{ - "headers":{ + "response":{ + "headers":{ "Content-Type":"text\/xml; charset=utf-8\n\r", "Content-Length":"length\n\r" }, - "body":[ + "body":[ "\n\r", "\n\r", " \n\r", @@ -104,13 +104,13 @@ "<\/soap:Envelope>\n\r" ] }, - "expected":{ + "expected":{ "audit_log":"", "debug_log":"", "error_log":"", "http_code": 200 }, - "rules":[ + "rules":[ "SecRuleEngine On", "SecRule REQUEST_HEADERS|!REQUEST_HEADERS \"@contains html\" \"id:1,t:lowercase,t:none,block,deny,status:300\"" ] From 6ba8eac908a5b3b8d39296808555cf1f39d2ff4b Mon Sep 17 00:00:00 2001 From: Hiroaki Nakamura Date: Wed, 17 Dec 2025 20:16:10 +0900 Subject: [PATCH 04/26] Add regression test cases for SecRequestBodyLimitAction ProcessPartial --- .../regression/config-body_limits.json | 284 ++++++++++++++++++ 1 file changed, 284 insertions(+) diff --git a/test/test-cases/regression/config-body_limits.json b/test/test-cases/regression/config-body_limits.json index 8b8b5d2e15..93fc5313c3 100644 --- a/test/test-cases/regression/config-body_limits.json +++ b/test/test-cases/regression/config-body_limits.json @@ -307,6 +307,290 @@ "SecRequestBodyLimit 5" ] }, + { + "enabled":1, + "version_min":300000, + "title":"SecRequestBodyLimitAction ProcessPartial - url-encoded, bad value before limit", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Type": "application/x-www-form-urlencoded", + "Content-Length": "11" + }, + "uri":"/", + "method":"POST", + "body": [ + "a=bad_value" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":403 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyLimitAction ProcessPartial", + "SecRequestBodyLimit 11", + "SecRule ARGS \"bad_value\" \"id:'200001',phase:2,t:none,deny" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"SecRequestBodyLimitAction ProcessPartial - url-encoded, bad value after limit", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Type": "application/x-www-form-urlencoded", + "Content-Length": "12" + }, + "uri":"/", + "method":"POST", + "body": [ + "aa=bad_value" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":200 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyLimitAction ProcessPartial", + "SecRequestBodyLimit 11", + "SecRule ARGS \"bad_value\" \"id:'200001',phase:2,t:none,deny" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"SecRequestBodyLimitAction ProcessPartial - json, bad value before limit", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length": "17", + "Content-Type": "application/json" + }, + "uri":"/", + "method":"POST", + "body": [ + "{\"a\":\"bad_value\"}" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":403 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRequestBodyLimitAction ProcessPartial", + "SecRequestBodyLimit 16", + "SecRule REQUEST_HEADERS:Content-Type \"application/json\" \"id:'200001',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=JSON\"", + "SecRule ARGS \"bad_value\" \"id:'200002',phase:2,t:none,deny" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"SecRequestBodyLimitAction ProcessPartial - json, bad value after limit", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length": "17", + "Content-Type": "application/json" + }, + "uri":"/", + "method":"POST", + "body": [ + "{\"a\":\"bad_value\"}" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":200 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRequestBodyLimitAction ProcessPartial", + "SecRequestBodyLimit 15", + "SecRule REQUEST_HEADERS:Content-Type \"application/json\" \"id:'200001',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=JSON\"", + "SecRule ARGS \"bad_value\" \"id:'200002',phase:2,t:none,deny" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"SecRequestBodyLimitAction ProcessPartial - xml, bad value before limit", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length": "17", + "Content-Type": "application/xml" + }, + "uri":"/", + "method":"POST", + "body": [ + "bad_value" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":403 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRequestBodyLimitAction ProcessPartial", + "SecRequestBodyLimit 12", + "SecRule REQUEST_HEADERS:Content-Type \"(?:application(?:/soap\\+|/)|text/)xml\" \"id:'200000',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=XML\"", + "SecRule XML:/* \"bad_value\" \"id:'200002',phase:2,t:none,deny" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"SecRequestBodyLimitAction ProcessPartial - xml, bad value after limit", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length": "17", + "Content-Type": "application/xml" + }, + "uri":"/", + "method":"POST", + "body": [ + "bad_value" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":200 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRequestBodyLimitAction ProcessPartial", + "SecRequestBodyLimit 11", + "SecRule REQUEST_HEADERS:Content-Type \"(?:application(?:/soap\\+|/)|text/)xml\" \"id:'200000',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=XML\"", + "SecRule XML:/* \"bad_value\" \"id:'200002',phase:2,t:none,deny" + ] + }, { "enabled":1, "version_min":300000, From b77a1a77adbaf1db6cfbb1c2ac383a34a97592fe Mon Sep 17 00:00:00 2001 From: Hiroaki Nakamura Date: Wed, 17 Dec 2025 20:01:45 +0900 Subject: [PATCH 05/26] Use unique_ptr for XML and JSON request body processors --- headers/modsecurity/transaction.h | 4 ++-- src/transaction.cc | 11 ++--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/headers/modsecurity/transaction.h b/headers/modsecurity/transaction.h index 3e70caa38e..75dbe843bf 100644 --- a/headers/modsecurity/transaction.h +++ b/headers/modsecurity/transaction.h @@ -614,8 +614,8 @@ class Transaction : public TransactionAnchoredVariables, public TransactionSecMa */ std::list m_matched; - RequestBodyProcessor::XML *m_xml; - RequestBodyProcessor::JSON *m_json; + std::unique_ptr m_xml; + std::unique_ptr m_json; int m_secRuleEngine; int m_secXMLParseXmlIntoArgs; diff --git a/src/transaction.cc b/src/transaction.cc index a091c2666d..2d6b7ba355 100644 --- a/src/transaction.cc +++ b/src/transaction.cc @@ -138,13 +138,13 @@ Transaction::Transaction(ModSecurity *ms, RulesSet *rules, const char *id, ms->m_session_collection, ms->m_user_collection, ms->m_resource_collection), #ifdef WITH_LIBXML2 - m_xml(new RequestBodyProcessor::XML(this, + m_xml(std::make_unique(this, this->m_rules->m_requestBodyLimitAction != RulesSet::BodyLimitAction::ProcessPartialBodyLimitAction)), #else m_xml(nullptr), #endif #ifdef WITH_YAJL - m_json(new RequestBodyProcessor::JSON(this, + m_json(std::make_unique(this, this->m_rules->m_requestBodyLimitAction == RulesSet::BodyLimitAction::ProcessPartialBodyLimitAction)), #else m_json(nullptr), @@ -174,13 +174,6 @@ Transaction::~Transaction() { intervention::free(&m_it); intervention::clean(&m_it); - -#ifdef WITH_YAJL - delete m_json; -#endif -#ifdef WITH_LIBXML2 - delete m_xml; -#endif } From 7e0f58f85d3be4ca03f323ed11a7486e230d16a7 Mon Sep 17 00:00:00 2001 From: Hiroaki Nakamura Date: Thu, 18 Dec 2025 21:16:55 +0900 Subject: [PATCH 06/26] Do partial processing if action is ProcessPartial and request body size exceeds limit In other words, if the request body size is equal or less than the RequestBodySizeLimit, the request processor requires a well-formed XML and does not allow a partial JSON, even if SecRequestBodyLimitAction is set to ProcessPartial. --- headers/modsecurity/transaction.h | 5 + src/request_body_processor/json.cc | 7 +- src/request_body_processor/json.h | 4 +- src/request_body_processor/xml.cc | 7 +- src/request_body_processor/xml.h | 4 +- src/transaction.cc | 35 +- test/regression/regression.cc | 1 + .../regression/config-body_limits.json | 314 +++++++++++++++++- 8 files changed, 345 insertions(+), 32 deletions(-) diff --git a/headers/modsecurity/transaction.h b/headers/modsecurity/transaction.h index 75dbe843bf..126dc6cee9 100644 --- a/headers/modsecurity/transaction.h +++ b/headers/modsecurity/transaction.h @@ -645,6 +645,11 @@ class Transaction : public TransactionAnchoredVariables, public TransactionSecMa * the web server (connector) log. */ void *m_logCbData; + + /** + * Whether the request body was bigger than RequestBodyLimit. + */ + bool m_requestBodyLimitExceeded; }; diff --git a/src/request_body_processor/json.cc b/src/request_body_processor/json.cc index 86004c8c4f..81e910cc0f 100644 --- a/src/request_body_processor/json.cc +++ b/src/request_body_processor/json.cc @@ -29,7 +29,7 @@ namespace RequestBodyProcessor { static const double json_depth_limit_default = 10000.0; static const char* json_depth_limit_exceeded_msg = ". Parsing depth limit exceeded"; -JSON::JSON(Transaction *transaction, unsigned int allow_partial_values) +JSON::JSON(Transaction *transaction) : m_transaction(transaction), m_handle(NULL), m_current_key(""), @@ -69,8 +69,6 @@ JSON::JSON(Transaction *transaction, unsigned int allow_partial_values) * TODO: make UTF8 validation optional, as it depends on Content-Encoding */ m_handle = yajl_alloc(&callbacks, NULL, this); - - yajl_config(m_handle, yajl_allow_partial_values, allow_partial_values); } @@ -84,7 +82,8 @@ JSON::~JSON() { } -bool JSON::init() { +bool JSON::init(unsigned int allow_partial_values) { + yajl_config(m_handle, yajl_allow_partial_values, allow_partial_values); return true; } diff --git a/src/request_body_processor/json.h b/src/request_body_processor/json.h index d542e85283..7a2c2b505b 100644 --- a/src/request_body_processor/json.h +++ b/src/request_body_processor/json.h @@ -57,10 +57,10 @@ class JSONContainerMap : public JSONContainer { class JSON { public: - explicit JSON(Transaction *transaction, unsigned int allow_partial_values = 0); + explicit JSON(Transaction *transaction); ~JSON(); - static bool init(); + bool init(unsigned int allow_partial_values = 0); bool processChunk(const char *buf, unsigned int size, std::string *err); bool complete(std::string *err); diff --git a/src/request_body_processor/xml.cc b/src/request_body_processor/xml.cc index 14576810f2..8cd169eb16 100644 --- a/src/request_body_processor/xml.cc +++ b/src/request_body_processor/xml.cc @@ -149,8 +149,8 @@ extern "C" { } } -XML::XML(Transaction *transaction, bool require_well_formed) - : m_transaction(transaction), m_require_well_formed(require_well_formed) { +XML::XML(Transaction *transaction) + : m_transaction(transaction), m_require_well_formed(false) { m_data.doc = NULL; m_data.parsing_ctx = NULL; m_data.sax_handler = NULL; @@ -171,7 +171,8 @@ XML::~XML() { } } -bool XML::init() { +bool XML::init(bool require_well_formed) { + m_require_well_formed = require_well_formed; //xmlParserInputBufferCreateFilenameFunc entity; if (m_transaction->m_rules->m_secXMLExternalEntity == RulesSetProperties::TrueConfigBoolean) { diff --git a/src/request_body_processor/xml.h b/src/request_body_processor/xml.h index 0cc92e0416..b3618ed48f 100644 --- a/src/request_body_processor/xml.h +++ b/src/request_body_processor/xml.h @@ -85,9 +85,9 @@ typedef struct xml_data xml_data; class XML { public: - explicit XML(Transaction *transaction, bool require_well_formed = true); + explicit XML(Transaction *transaction); ~XML(); - bool init(); + bool init(bool require_well_formed = true); bool processChunk(const char *buf, unsigned int size, std::string *err); bool complete(std::string *err); static xmlParserInputBufferPtr unloadExternalEntity(const char *URI, diff --git a/src/transaction.cc b/src/transaction.cc index 2d6b7ba355..9196961cbe 100644 --- a/src/transaction.cc +++ b/src/transaction.cc @@ -138,20 +138,19 @@ Transaction::Transaction(ModSecurity *ms, RulesSet *rules, const char *id, ms->m_session_collection, ms->m_user_collection, ms->m_resource_collection), #ifdef WITH_LIBXML2 - m_xml(std::make_unique(this, - this->m_rules->m_requestBodyLimitAction != RulesSet::BodyLimitAction::ProcessPartialBodyLimitAction)), + m_xml(std::make_unique(this)), #else m_xml(nullptr), #endif #ifdef WITH_YAJL - m_json(std::make_unique(this, - this->m_rules->m_requestBodyLimitAction == RulesSet::BodyLimitAction::ProcessPartialBodyLimitAction)), + m_json(std::make_unique(this)), #else m_json(nullptr), #endif m_secRuleEngine(RulesSetProperties::PropertyNotSetRuleEngine), m_secXMLParseXmlIntoArgs(rules->m_secXMLParseXmlIntoArgs), m_logCbData(logCbData), + m_requestBodyLimitExceeded(false), TransactionAnchoredVariables(this) { m_variableUrlEncodedError.set("0", 0); m_variableMscPcreError.set("0", 0); @@ -689,27 +688,33 @@ int Transaction::processRequestBody() { std::unique_ptr a = m_variableRequestHeaders.resolveFirst( "Content-Type"); + bool is_process_partial = (m_rules->m_requestBodyLimitAction + == RulesSet::BodyLimitAction::ProcessPartialBodyLimitAction); + bool requestBodyNoFilesLimitExceeded = false; if ((m_requestBodyType == WWWFormUrlEncoded) || (m_requestBodyProcessor == JSONRequestBody) || (m_requestBodyProcessor == XMLRequestBody)) { if ((m_rules->m_requestBodyNoFilesLimit.m_set) && (m_requestBody.str().size() > m_rules->m_requestBodyNoFilesLimit.m_value)) { - m_variableReqbodyError.set("1", 0); - m_variableReqbodyErrorMsg.set("Request body excluding files is bigger than the maximum expected.", 0); - m_variableInboundDataError.set("1", m_variableOffset); - ms_dbg(5, "Request body excluding files is bigger than the maximum expected. Limit: " \ - + std::to_string(m_rules->m_requestBodyNoFilesLimit.m_value)); + if (!is_process_partial) { + m_variableReqbodyError.set("1", 0); + m_variableReqbodyErrorMsg.set("Request body excluding files is bigger than the maximum expected.", 0); + m_variableInboundDataError.set("1", m_variableOffset); + ms_dbg(5, "Request body excluding files is bigger than the maximum expected. Limit: " \ + + std::to_string(m_rules->m_requestBodyNoFilesLimit.m_value)); + } requestBodyNoFilesLimitExceeded = true; - } + } } #ifdef WITH_LIBXML2 if (m_requestBodyProcessor == XMLRequestBody) { // large size might cause issues in the parsing itself; omit if exceeded - if (!requestBodyNoFilesLimitExceeded) { + if (!requestBodyNoFilesLimitExceeded || is_process_partial) { std::string error; - if (m_xml->init() == true) { + bool require_well_formed = !(is_process_partial && m_requestBodyLimitExceeded); + if (m_xml->init(require_well_formed) == true) { m_xml->processChunk(m_requestBody.str().c_str(), m_requestBody.str().size(), &error); @@ -735,12 +740,13 @@ int Transaction::processRequestBody() { if (m_requestBodyProcessor == JSONRequestBody) { #endif // large size might cause issues in the parsing itself; omit if exceeded - if (!requestBodyNoFilesLimitExceeded) { + if (!requestBodyNoFilesLimitExceeded || is_process_partial) { std::string error; if (m_rules->m_requestBodyJsonDepthLimit.m_set) { m_json->setMaxDepth(m_rules->m_requestBodyJsonDepthLimit.m_value); } - if (m_json->init() == true) { + unsigned int allow_partial_values = is_process_partial && m_requestBodyLimitExceeded; + if (m_json->init(allow_partial_values) == true) { m_json->processChunk(m_requestBody.str().c_str(), m_requestBody.str().size(), &error); @@ -930,6 +936,7 @@ int Transaction::appendRequestBody(const unsigned char *buf, size_t len) { if (this->m_rules->m_requestBodyLimit.m_value > 0 && this->m_rules->m_requestBodyLimit.m_value < len + current_size) { + m_requestBodyLimitExceeded = true; m_variableInboundDataError.set("1", m_variableOffset); ms_dbg(5, "Request body is bigger than the maximum expected."); diff --git a/test/regression/regression.cc b/test/regression/regression.cc index ba37f76dfb..38dc1ff6e8 100644 --- a/test/regression/regression.cc +++ b/test/regression/regression.cc @@ -311,6 +311,7 @@ void perform_unit_test(const ModSecurityTest &test, modsec_transaction.appendResponseBody( (unsigned char *)t->response_body.c_str(), t->response_body.size()); + modsec_transaction.processResponseBody(); actions(&r, &modsec_transaction, &context.m_server_log); diff --git a/test/test-cases/regression/config-body_limits.json b/test/test-cases/regression/config-body_limits.json index 93fc5313c3..3438e265d4 100644 --- a/test/test-cases/regression/config-body_limits.json +++ b/test/test-cases/regression/config-body_limits.json @@ -253,7 +253,7 @@ { "enabled":1, "version_min":300000, - "title":"SecRequestBodyLimitAction ProcessPartial", + "title":"SecRequestBodyLimitAction ProcessPartial - multipart", "client":{ "ip":"200.249.12.31", "port":123 @@ -266,7 +266,9 @@ "headers":{ "Host":"localhost", "User-Agent":"curl/7.38.0", - "Accept":"*/*" + "Accept":"*/*", + "Content-Type": "multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2", + "Content-Length": "508" }, "uri":"/?key=value&key=other_value", "method":"POST", @@ -304,7 +306,7 @@ "rules":[ "SecRuleEngine On", "SecRequestBodyLimitAction ProcessPartial", - "SecRequestBodyLimit 5" + "SecRequestBodyLimit 508" ] }, { @@ -350,7 +352,8 @@ "SecRuleEngine On", "SecRequestBodyLimitAction ProcessPartial", "SecRequestBodyLimit 11", - "SecRule ARGS \"bad_value\" \"id:'200001',phase:2,t:none,deny" + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200001', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2\"", + "SecRule ARGS \"bad_value\" \"id:'200002',phase:2,t:none,deny" ] }, { @@ -396,7 +399,8 @@ "SecRuleEngine On", "SecRequestBodyLimitAction ProcessPartial", "SecRequestBodyLimit 11", - "SecRule ARGS \"bad_value\" \"id:'200001',phase:2,t:none,deny" + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200001', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2\"", + "SecRule ARGS \"bad_value\" \"id:'200002',phase:2,t:none,deny" ] }, { @@ -443,7 +447,8 @@ "SecRequestBodyAccess On", "SecRequestBodyLimitAction ProcessPartial", "SecRequestBodyLimit 16", - "SecRule REQUEST_HEADERS:Content-Type \"application/json\" \"id:'200001',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=JSON\"", + "SecRule REQUEST_HEADERS:Content-Type \"application/json\" \"id:'200000',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=JSON\"", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200001', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2\"", "SecRule ARGS \"bad_value\" \"id:'200002',phase:2,t:none,deny" ] }, @@ -491,10 +496,158 @@ "SecRequestBodyAccess On", "SecRequestBodyLimitAction ProcessPartial", "SecRequestBodyLimit 15", - "SecRule REQUEST_HEADERS:Content-Type \"application/json\" \"id:'200001',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=JSON\"", + "SecRule REQUEST_HEADERS:Content-Type \"application/json\" \"id:'200000',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=JSON\"", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200001', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2\"", "SecRule ARGS \"bad_value\" \"id:'200002',phase:2,t:none,deny" ] }, + { + "enabled":1, + "version_min":300000, + "title":"SecRequestBodyLimitAction ProcessPartial - json, too many closes after limit", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length": "8", + "Content-Type": "application/json" + }, + "uri":"/", + "method":"POST", + "body": [ + "{\"a\":1}}" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":200 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRequestBodyLimitAction ProcessPartial", + "SecRequestBodyLimit 7", + "SecRule REQUEST_HEADERS:Content-Type \"application/json\" \"id:'200000',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=JSON\"", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200001', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2\"", + "SecRule ARGS \"bad_value\" \"id:'200002',phase:2,t:none,deny" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"SecRequestBodyLimitAction ProcessPartial - json, too many closes before limit", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length": "8", + "Content-Type": "application/json" + }, + "uri":"/", + "method":"POST", + "body": [ + "{\"a\":1}}" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":400 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRequestBodyLimitAction ProcessPartial", + "SecRequestBodyLimit 16", + "SecRule REQUEST_HEADERS:Content-Type \"application/json\" \"id:'200000',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=JSON\"", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200001', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2\"", + "SecRule ARGS \"bad_value\" \"id:'200002',phase:2,t:none,deny" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"SecRequestBodyLimitAction ProcessPartial - json, too many closes after limit", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length": "9", + "Content-Type": "application/json" + }, + "uri":"/", + "method":"POST", + "body": [ + "{\"a\":1}}" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":200 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRequestBodyLimitAction ProcessPartial", + "SecRequestBodyLimit 7", + "SecRule REQUEST_HEADERS:Content-Type \"application/json\" \"id:'200000',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=JSON\"", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200001', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2\"", + "SecRule ARGS \"bad_value\" \"id:'200002',phase:2,t:none,deny" + ] + }, { "enabled":1, "version_min":300000, @@ -540,6 +693,7 @@ "SecRequestBodyLimitAction ProcessPartial", "SecRequestBodyLimit 12", "SecRule REQUEST_HEADERS:Content-Type \"(?:application(?:/soap\\+|/)|text/)xml\" \"id:'200000',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=XML\"", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200001', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2\"", "SecRule XML:/* \"bad_value\" \"id:'200002',phase:2,t:none,deny" ] }, @@ -588,9 +742,155 @@ "SecRequestBodyLimitAction ProcessPartial", "SecRequestBodyLimit 11", "SecRule REQUEST_HEADERS:Content-Type \"(?:application(?:/soap\\+|/)|text/)xml\" \"id:'200000',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=XML\"", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200001', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2\"", "SecRule XML:/* \"bad_value\" \"id:'200002',phase:2,t:none,deny" ] }, + { + "enabled":1, + "version_min":300000, + "title":"SecRequestBodyLimitAction ProcessPartial - xml, ill-formed, but well-formed before limit", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length": "12", + "Content-Type": "application/xml" + }, + "uri":"/", + "method":"POST", + "body": [ + "" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":200 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRequestBodyLimitAction ProcessPartial", + "SecRequestBodyLimit 8", + "SecRule REQUEST_HEADERS:Content-Type \"(?:application(?:/soap\\+|/)|text/)xml\" \"id:'200000',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=XML\"", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200001', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"SecRequestBodyLimitAction ProcessPartial - xml, ill-formed starts just before limit", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length": "12", + "Content-Type": "application/xml" + }, + "uri":"/", + "method":"POST", + "body": [ + "" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":200 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRequestBodyLimitAction ProcessPartial", + "SecRequestBodyLimit 7", + "SecRule REQUEST_HEADERS:Content-Type \"(?:application(?:/soap\\+|/)|text/)xml\" \"id:'200000',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=XML\"", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200001', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"SecRequestBodyLimitAction ProcessPartial - RequestBodyNoFilesLimit ignored", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length": "12", + "Content-Type": "application/xml" + }, + "uri":"/", + "method":"POST", + "body": [ + "" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":200 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRequestBodyLimitAction ProcessPartial", + "SecRequestBodyLimit 7", + "SecRequestBodyNoFilesLimit 3", + "SecRule REQUEST_HEADERS:Content-Type \"(?:application(?:/soap\\+|/)|text/)xml\" \"id:'200000',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=XML\"", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200001', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2\"" + ] + }, { "enabled":1, "version_min":300000, From 1a8a04c8f5ef16113bf0de0d16f099e33e8dd804 Mon Sep 17 00:00:00 2001 From: Hiroaki Nakamura Date: Thu, 18 Dec 2025 21:44:19 +0900 Subject: [PATCH 07/26] Stop using unique_ptr for XML and JSON request body processor --- headers/modsecurity/transaction.h | 4 ++-- src/transaction.cc | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/headers/modsecurity/transaction.h b/headers/modsecurity/transaction.h index 126dc6cee9..ff56d90db5 100644 --- a/headers/modsecurity/transaction.h +++ b/headers/modsecurity/transaction.h @@ -614,8 +614,8 @@ class Transaction : public TransactionAnchoredVariables, public TransactionSecMa */ std::list m_matched; - std::unique_ptr m_xml; - std::unique_ptr m_json; + RequestBodyProcessor::XML *m_xml; + RequestBodyProcessor::JSON *m_json; int m_secRuleEngine; int m_secXMLParseXmlIntoArgs; diff --git a/src/transaction.cc b/src/transaction.cc index 9196961cbe..da4c771d9f 100644 --- a/src/transaction.cc +++ b/src/transaction.cc @@ -138,12 +138,12 @@ Transaction::Transaction(ModSecurity *ms, RulesSet *rules, const char *id, ms->m_session_collection, ms->m_user_collection, ms->m_resource_collection), #ifdef WITH_LIBXML2 - m_xml(std::make_unique(this)), + m_xml(new RequestBodyProcessor::XML(this)), #else m_xml(nullptr), #endif #ifdef WITH_YAJL - m_json(std::make_unique(this)), + m_json(new RequestBodyProcessor::JSON(this)), #else m_json(nullptr), #endif @@ -173,6 +173,13 @@ Transaction::~Transaction() { intervention::free(&m_it); intervention::clean(&m_it); + +#ifdef WITH_YAJL + delete m_json; +#endif +#ifdef WITH_LIBXML2 + delete m_xml; +#endif } From c981a1621c957aa2c249853896ef1911fe132a5b Mon Sep 17 00:00:00 2001 From: Hiroaki Nakamura Date: Mon, 29 Dec 2025 14:53:29 +0900 Subject: [PATCH 08/26] Skip tests using XML request processor when libxml2 is unavailable --- test/test-cases/regression/config-body_limits.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/test-cases/regression/config-body_limits.json b/test/test-cases/regression/config-body_limits.json index 3438e265d4..07db589acc 100644 --- a/test/test-cases/regression/config-body_limits.json +++ b/test/test-cases/regression/config-body_limits.json @@ -647,10 +647,11 @@ "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200001', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2\"", "SecRule ARGS \"bad_value\" \"id:'200002',phase:2,t:none,deny" ] - }, + }, { "enabled":1, "version_min":300000, + "resource":"libxml2", "title":"SecRequestBodyLimitAction ProcessPartial - xml, bad value before limit", "client":{ "ip":"200.249.12.31", @@ -700,6 +701,7 @@ { "enabled":1, "version_min":300000, + "resource":"libxml2", "title":"SecRequestBodyLimitAction ProcessPartial - xml, bad value after limit", "client":{ "ip":"200.249.12.31", @@ -749,6 +751,7 @@ { "enabled":1, "version_min":300000, + "resource":"libxml2", "title":"SecRequestBodyLimitAction ProcessPartial - xml, ill-formed, but well-formed before limit", "client":{ "ip":"200.249.12.31", @@ -797,6 +800,7 @@ { "enabled":1, "version_min":300000, + "resource":"libxml2", "title":"SecRequestBodyLimitAction ProcessPartial - xml, ill-formed starts just before limit", "client":{ "ip":"200.249.12.31", @@ -845,6 +849,7 @@ { "enabled":1, "version_min":300000, + "resource":"libxml2", "title":"SecRequestBodyLimitAction ProcessPartial - RequestBodyNoFilesLimit ignored", "client":{ "ip":"200.249.12.31", From 2a7c385b90a2848605f904cdcb4d4ecba0f02a6d Mon Sep 17 00:00:00 2001 From: Hiroaki Nakamura Date: Mon, 29 Dec 2025 17:19:58 +0900 Subject: [PATCH 09/26] Add debug log for allowing partial processing of JSON and XML --- src/transaction.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/transaction.cc b/src/transaction.cc index da4c771d9f..f029e062de 100644 --- a/src/transaction.cc +++ b/src/transaction.cc @@ -721,6 +721,9 @@ int Transaction::processRequestBody() { if (!requestBodyNoFilesLimitExceeded || is_process_partial) { std::string error; bool require_well_formed = !(is_process_partial && m_requestBodyLimitExceeded); + if (!require_well_formed) { + ms_dbg(4, "XML: Allow partial processing of request body"); + } if (m_xml->init(require_well_formed) == true) { m_xml->processChunk(m_requestBody.str().c_str(), m_requestBody.str().size(), @@ -753,6 +756,9 @@ int Transaction::processRequestBody() { m_json->setMaxDepth(m_rules->m_requestBodyJsonDepthLimit.m_value); } unsigned int allow_partial_values = is_process_partial && m_requestBodyLimitExceeded; + if (allow_partial_values) { + ms_dbg(4, "JSON: Allow partial processing of request body"); + } if (m_json->init(allow_partial_values) == true) { m_json->processChunk(m_requestBody.str().c_str(), m_requestBody.str().size(), From 400e871393c7c87e9eb84b703d82c5fb867d497e Mon Sep 17 00:00:00 2001 From: Hiroaki Nakamura Date: Sun, 28 Dec 2025 18:36:01 +0900 Subject: [PATCH 10/26] Stop adding LF to the end of each body line in regression tests Instead, add LF explicitly in the test data. This makes it easier to write edge-case tests for request body length limits. --- test/regression/regression_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/regression/regression_test.cc b/test/regression/regression_test.cc index 01ad2aacc9..8df1d1c035 100644 --- a/test/regression/regression_test.cc +++ b/test/regression/regression_test.cc @@ -48,7 +48,7 @@ inline std::string RegressionTest::yajl_array_to_str(const yajl_val &node) { for (int z = 0; z < node->u.array.len; z++) { yajl_val val3 = node->u.array.values[z]; const char *key = YAJL_GET_STRING(val3); - i << key << "\n"; + i << key; } return i.str(); } From 6382a3c85783b6bf961a1d2f884b5ea6be25760b Mon Sep 17 00:00:00 2001 From: Hiroaki Nakamura Date: Mon, 29 Dec 2025 15:37:33 +0900 Subject: [PATCH 11/26] Append LF to request and response body lines in regression test cases --- .../regression/action-ctl_audit_engine.json | 2 +- .../action-ctl_request_body_access.json | 96 +- .../action-ctl_request_body_processor.json | 126 +- ...ctl_request_body_processor_urlencoded.json | 8 +- .../regression/action-ctl_rule_engine.json | 14 +- .../action-ctl_rule_remove_by_tag.json | 4 +- test/test-cases/regression/action-exec.json | 6 +- test/test-cases/regression/action-id.json | 24 +- test/test-cases/regression/action-msg.json | 36 +- test/test-cases/regression/action-tag.json | 36 +- .../regression/action-tnf-base64.json | 8 +- test/test-cases/regression/action-xmlns.json | 62 +- test/test-cases/regression/actions.json | 108 +- test/test-cases/regression/auditlog.json | 42 +- .../collection-case-insensitive.json | 18 +- .../test-cases/regression/collection-lua.json | 14 +- ...llection-regular_expression_selection.json | 36 +- .../regression/collection-resource.json | 4 +- .../regression/collection-tx-with-macro.json | 72 +- test/test-cases/regression/collection-tx.json | 94 +- .../regression/config-body_limits.json | 248 +-- .../config-calling_phases_by_name.json | 4 +- .../test-cases/regression/config-include.json | 16 +- .../regression/config-remove_by_id.json | 6 +- .../regression/config-remove_by_msg.json | 4 +- .../regression/config-remove_by_tag.json | 4 +- .../regression/config-response_type.json | 6 +- .../regression/config-secdefaultaction.json | 72 +- .../regression/config-secremoterules.json | 4 +- .../config-update-action-by-id.json | 12 +- .../config-update-target-by-id.json | 10 +- .../config-update-target-by-msg.json | 2 +- .../config-update-target-by-tag.json | 14 +- .../config-xml_external_entity.json | 48 +- test/test-cases/regression/debug_log.json | 18 +- .../regression/directive-sec_rule_script.json | 8 +- .../test-cases/regression/fn-setHostname.json | 2 +- test/test-cases/regression/issue-1152.json | 8 +- test/test-cases/regression/issue-1528.json | 4 +- test/test-cases/regression/issue-1565.json | 8 +- test/test-cases/regression/issue-1576.json | 60 +- test/test-cases/regression/issue-1591.json | 12 +- test/test-cases/regression/issue-1725.json | 4 +- test/test-cases/regression/issue-1743.json | 8 +- test/test-cases/regression/issue-1785.json | 2 +- test/test-cases/regression/issue-1812.json | 2 +- test/test-cases/regression/issue-1825.json | 154 +- test/test-cases/regression/issue-1831.json | 8 +- test/test-cases/regression/issue-1844.json | 24 +- test/test-cases/regression/issue-1850.json | 2 +- test/test-cases/regression/issue-1941.json | 36 +- test/test-cases/regression/issue-1943.json | 36 +- test/test-cases/regression/issue-1956.json | 20 +- test/test-cases/regression/issue-1960.json | 2 +- test/test-cases/regression/issue-2000.json | 2 +- test/test-cases/regression/issue-2099.json | 12 +- test/test-cases/regression/issue-2111.json | 2 +- test/test-cases/regression/issue-2196.json | 2 +- test/test-cases/regression/issue-2296.json | 20 +- test/test-cases/regression/issue-2427.json | 76 +- test/test-cases/regression/issue-3340.json | 4 +- test/test-cases/regression/issue-394.json | 4 +- test/test-cases/regression/issue-849.json | 4 +- test/test-cases/regression/issue-960.json | 12 +- .../misc-variable-under-quotes.json | 4 +- .../regression/offset-variable.json | 746 ++++---- .../operator-UnconditionalMatch.json | 4 +- .../regression/operator-detectsqli.json | 4 +- .../regression/operator-detectxss.json | 4 +- .../regression/operator-fuzzyhash.json | 252 +-- .../regression/operator-inpectFile.json | 20 +- .../regression/operator-ipMatchFromFile.json | 12 +- test/test-cases/regression/operator-pm.json | 12 +- .../regression/operator-pmfromfile.json | 2 +- test/test-cases/regression/operator-rx.json | 14 +- .../regression/operator-rxGlobal.json | 4 +- .../operator-validate-byte-range.json | 2 +- .../regression/operator-verifycc.json | 4 +- .../regression/operator-verifycpf.json | 4 +- .../regression/operator-verifyssn.json | 4 +- .../regression/operator-verifysvnr.json | 4 +- .../regression/request-body-parser-json.json | 68 +- .../request-body-parser-multipart-crlf.json | 32 +- .../request-body-parser-multipart.json | 1702 ++++++++--------- .../request-body-parser-xml-validade-dtd.json | 72 +- .../regression/request-body-parser-xml.json | 130 +- test/test-cases/regression/rule-920120.json | 32 +- test/test-cases/regression/rule-920200.json | 2 +- test/test-cases/regression/rule-920274.json | 2 +- .../regression/sec_component_signature.json | 4 +- test/test-cases/regression/secaction.json | 18 +- .../regression/secargumentslimit.json | 28 +- test/test-cases/regression/secmarker.json | 36 +- .../regression/transformation-none.json | 36 +- .../regression/transformations.json | 36 +- test/test-cases/regression/variable-ARGS.json | 24 +- .../variable-ARGS_COMBINED_SIZE.json | 20 +- .../regression/variable-ARGS_GET.json | 12 +- .../regression/variable-ARGS_GET_NAMES.json | 4 +- .../regression/variable-ARGS_NAMES.json | 32 +- .../regression/variable-ARGS_POST.json | 12 +- .../regression/variable-ARGS_POST_NAMES.json | 48 +- .../regression/variable-AUTH_TYPE.json | 8 +- .../regression/variable-DURATION.json | 4 +- test/test-cases/regression/variable-ENV.json | 16 +- .../test-cases/regression/variable-FILES.json | 64 +- .../variable-FILES_COMBINED_SIZE.json | 32 +- .../regression/variable-FILES_NAMES.json | 32 +- .../regression/variable-FILES_SIZES.json | 32 +- .../regression/variable-FULL_REQUEST.json | 32 +- .../variable-FULL_REQUEST_LENGTH.json | 32 +- test/test-cases/regression/variable-GEO.json | 36 +- .../regression/variable-HIGHEST_SEVERITY.json | 4 +- .../variable-INBOUND_DATA_ERROR.json | 34 +- .../regression/variable-MATCHED_VAR.json | 10 +- .../regression/variable-MATCHED_VARS.json | 12 +- .../variable-MATCHED_VARS_NAMES.json | 10 +- .../regression/variable-MATCHED_VAR_NAME.json | 14 +- .../regression/variable-MODSEC_BUILD.json | 4 +- .../variable-MULTIPART_CRLF_LF_LINES.json | 64 +- .../variable-MULTIPART_FILENAME.json | 64 +- ...able-MULTIPART_INVALID_HEADER_FOLDING.json | 24 +- .../regression/variable-MULTIPART_NAME.json | 64 +- .../variable-MULTIPART_PART_HEADERS.json | 80 +- .../variable-MULTIPART_STRICT_ERROR.json | 236 +-- ...variable-MULTIPART_UNMATCHED_BOUNDARY.json | 32 +- .../variable-OUTBOUND_DATA_ERROR.json | 62 +- .../regression/variable-PATH_INFO.json | 16 +- .../regression/variable-QUERY_STRING.json | 6 +- .../regression/variable-REMOTE_ADDR.json | 4 +- .../regression/variable-REMOTE_HOST.json | 4 +- .../regression/variable-REMOTE_PORT.json | 4 +- .../regression/variable-REMOTE_USER.json | 2 +- .../variable-REQBODY_PROCESSOR.json | 100 +- .../variable-REQBODY_PROCESSOR_ERROR.json | 94 +- .../regression/variable-REQUEST_BASENAME.json | 4 +- .../regression/variable-REQUEST_BODY.json | 32 +- .../variable-REQUEST_BODY_LENGTH.json | 32 +- .../regression/variable-REQUEST_COOKIES.json | 12 +- .../variable-REQUEST_COOKIES_NAMES.json | 8 +- .../regression/variable-REQUEST_FILENAME.json | 2 +- .../regression/variable-REQUEST_HEADERS.json | 32 +- .../variable-REQUEST_HEADERS_NAMES.json | 192 +- .../regression/variable-REQUEST_LINE.json | 6 +- .../regression/variable-REQUEST_METHOD.json | 2 +- .../regression/variable-REQUEST_PROTOCOL.json | 2 +- .../regression/variable-REQUEST_URI.json | 6 +- .../regression/variable-REQUEST_URI_RAW.json | 6 +- .../regression/variable-RESPONSE_BODY.json | 2 +- .../variable-RESPONSE_CONTENT_LENGTH.json | 2 +- .../variable-RESPONSE_CONTENT_TYPE.json | 2 +- .../regression/variable-RESPONSE_HEADERS.json | 32 +- .../variable-RESPONSE_HEADERS_NAMES.json | 96 +- .../variable-RESPONSE_PROTOCOL.json | 2 +- test/test-cases/regression/variable-RULE.json | 28 +- .../regression/variable-SERVER_ADDR.json | 4 +- .../regression/variable-SERVER_NAME.json | 4 +- .../regression/variable-SERVER_PORT.json | 4 +- .../regression/variable-STATUS.json | 8 +- test/test-cases/regression/variable-TIME.json | 2 +- .../regression/variable-TIME_DAY.json | 2 +- .../regression/variable-TIME_EPOCH.json | 2 +- .../regression/variable-TIME_HOUR.json | 2 +- .../regression/variable-TIME_MIN.json | 2 +- .../regression/variable-TIME_MON.json | 2 +- .../regression/variable-TIME_SEC.json | 2 +- .../regression/variable-TIME_WDAY.json | 2 +- .../regression/variable-TIME_YEAR.json | 2 +- test/test-cases/regression/variable-TX.json | 12 +- .../regression/variable-UNIQUE_ID.json | 2 +- .../regression/variable-URLENCODED_ERROR.json | 20 +- .../regression/variable-WEBAPPID.json | 8 +- test/test-cases/regression/variable-XML.json | 214 +-- .../regression/variable-variation-count.json | 54 +- .../variable-variation-exclusion.json | 36 +- 175 files changed, 3689 insertions(+), 3689 deletions(-) diff --git a/test/test-cases/regression/action-ctl_audit_engine.json b/test/test-cases/regression/action-ctl_audit_engine.json index 3848ee7e55..7cf1a62b11 100644 --- a/test/test-cases/regression/action-ctl_audit_engine.json +++ b/test/test-cases/regression/action-ctl_audit_engine.json @@ -28,7 +28,7 @@ "uri": "\/test.pl?parm1=test1&parm2=test2", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "expected": { "audit_log": "--A--", diff --git a/test/test-cases/regression/action-ctl_request_body_access.json b/test/test-cases/regression/action-ctl_request_body_access.json index a7eed77f5c..2a3b1f96ed 100644 --- a/test/test-cases/regression/action-ctl_request_body_access.json +++ b/test/test-cases/regression/action-ctl_request_body_access.json @@ -23,21 +23,21 @@ "uri":"/test", "method":"POST", "body":[ - "--------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "--------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "--------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "--------------------------756b6d74fa1a8ee2--" + "--------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "--------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "--------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "--------------------------756b6d74fa1a8ee2--\n" ] }, "response":{ @@ -47,7 +47,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -84,21 +84,21 @@ "uri":"/test", "method":"POST", "body":[ - "--------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "--------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "--------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "--------------------------756b6d74fa1a8ee2--" + "--------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "--------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "--------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "--------------------------756b6d74fa1a8ee2--\n" ] }, "response":{ @@ -108,7 +108,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -145,21 +145,21 @@ "uri":"/test", "method":"POST", "body":[ - "--------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "--------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "--------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "--------------------------756b6d74fa1a8ee2--" + "--------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "--------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "--------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "--------------------------756b6d74fa1a8ee2--\n" ] }, "response":{ @@ -169,7 +169,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/action-ctl_request_body_processor.json b/test/test-cases/regression/action-ctl_request_body_processor.json index 52cfc2e651..ff34b522ac 100644 --- a/test/test-cases/regression/action-ctl_request_body_processor.json +++ b/test/test-cases/regression/action-ctl_request_body_processor.json @@ -22,40 +22,40 @@ "uri":"/?key=value&key=other_value", "method":"POST", "body": [ - "", - "", - "", - "Everyday Italian", - "Giada De Laurentiis", - "2005", - "30.00", - "", + "\n", + "\n", + "\n", + "Everyday Italian\n", + "Giada De Laurentiis\n", + "2005\n", + "30.00\n", + "\n", - "", - "Harry Potter", - "J K. Rowling", - "2005", - "29.99", - "", + "\n", + "Harry Potter\n", + "J K. Rowling\n", + "2005\n", + "29.99\n", + "\n", - "", - "XQuery Kick Start", - "James McGovern", - "Per Bothner", - "Kurt Cagle", - "James Linn", - "Vaidyanathan Nagarajan", - "2003", - "49.99", - "", + "\n", + "XQuery Kick Start\n", + "James McGovern\n", + "Per Bothner\n", + "Kurt Cagle\n", + "James Linn\n", + "Vaidyanathan Nagarajan\n", + "2003\n", + "49.99\n", + "\n", - "", - "Learning XML", - "Erik T. Ray", - "2003", - "39.95", - "", - "" + "\n", + "Learning XML\n", + "Erik T. Ray\n", + "2003\n", + "39.95\n", + "\n", + "\n" ] }, "server":{ @@ -92,40 +92,40 @@ "uri":"/?key=value&key=other_value", "method":"POST", "body": [ - "", - "", - "", - "Everyday Italian", - "Giada De Laurentiis", - "2005", - "30.00", - "", + "\n", + "\n", + "\n", + "Everyday Italian\n", + "Giada De Laurentiis\n", + "2005\n", + "30.00\n", + "\n", - "", - "Harry Potter", - "J K. Rowling", - "2005", - "29.99", - "", + "\n", + "Harry Potter\n", + "J K. Rowling\n", + "2005\n", + "29.99\n", + "\n", - "", - "XQuery Kick Start", - "James McGovern", - "Per Bothner", - "Kurt Cagle", - "James Linn", - "Vaidyanathan Nagarajan", - "2003", - "49.99", - "", + "\n", + "XQuery Kick Start\n", + "James McGovern\n", + "Per Bothner\n", + "Kurt Cagle\n", + "James Linn\n", + "Vaidyanathan Nagarajan\n", + "2003\n", + "49.99\n", + "\n", - "", - "Learning XML", - "Erik T. Ray", - "2003", - "39.95", - "", - "" + "\n", + "Learning XML\n", + "Erik T. Ray\n", + "2003\n", + "39.95\n", + "\n", + "\n" ] }, "server":{ @@ -161,7 +161,7 @@ "uri":"/?key=value&key=other_value", "method":"POST", "body": [ - "not a xml" + "not a xml\n" ] }, "server":{ diff --git a/test/test-cases/regression/action-ctl_request_body_processor_urlencoded.json b/test/test-cases/regression/action-ctl_request_body_processor_urlencoded.json index 2ad6093e84..89169d13ca 100644 --- a/test/test-cases/regression/action-ctl_request_body_processor_urlencoded.json +++ b/test/test-cases/regression/action-ctl_request_body_processor_urlencoded.json @@ -23,7 +23,7 @@ "uri":"/a=urlencoded", "method":"POST", "body":[ - "param1=value1\r" + "param1=value1\r\n" ] }, "response":{ @@ -33,7 +33,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -71,7 +71,7 @@ "uri":"/a=urlencoded", "method":"POST", "body":[ - "param1=value1\r" + "param1=value1\r\n" ] }, "response":{ @@ -81,7 +81,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/action-ctl_rule_engine.json b/test/test-cases/regression/action-ctl_rule_engine.json index 927b7077e8..ee39432a62 100644 --- a/test/test-cases/regression/action-ctl_rule_engine.json +++ b/test/test-cases/regression/action-ctl_rule_engine.json @@ -31,7 +31,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -77,7 +77,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -123,7 +123,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -168,7 +168,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -212,7 +212,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -256,7 +256,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -300,7 +300,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/action-ctl_rule_remove_by_tag.json b/test/test-cases/regression/action-ctl_rule_remove_by_tag.json index 6cf2923d58..b395f9c9af 100644 --- a/test/test-cases/regression/action-ctl_rule_remove_by_tag.json +++ b/test/test-cases/regression/action-ctl_rule_remove_by_tag.json @@ -27,7 +27,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -68,7 +68,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/action-exec.json b/test/test-cases/regression/action-exec.json index 80661114e0..6a444e7130 100644 --- a/test/test-cases/regression/action-exec.json +++ b/test/test-cases/regression/action-exec.json @@ -29,7 +29,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -78,7 +78,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -126,7 +126,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ diff --git a/test/test-cases/regression/action-id.json b/test/test-cases/regression/action-id.json index 9f9453c7e9..5d444bcd2d 100644 --- a/test/test-cases/regression/action-id.json +++ b/test/test-cases/regression/action-id.json @@ -22,7 +22,7 @@ "uri":"/", "method":"POST", "body": [ - "param1=value1¶m2=value2" + "param1=value1¶m2=value2\n" ] }, "response":{ @@ -32,7 +32,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -66,7 +66,7 @@ "uri":"/", "method":"POST", "body": [ - "param1=value1¶m2=value2" + "param1=value1¶m2=value2\n" ] }, "response":{ @@ -76,7 +76,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -110,7 +110,7 @@ "uri":"/", "method":"POST", "body": [ - "param1=value1¶m2=value2" + "param1=value1¶m2=value2\n" ] }, "response":{ @@ -120,7 +120,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -154,7 +154,7 @@ "uri":"/", "method":"POST", "body": [ - "param1=value1¶m2=value2" + "param1=value1¶m2=value2\n" ] }, "response":{ @@ -164,7 +164,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -198,7 +198,7 @@ "uri":"/", "method":"POST", "body": [ - "param1=value1¶m2=value2" + "param1=value1¶m2=value2\n" ] }, "response":{ @@ -208,7 +208,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -242,7 +242,7 @@ "uri":"/", "method":"POST", "body": [ - "param1=value1¶m2=value2" + "param1=value1¶m2=value2\n" ] }, "response":{ @@ -252,7 +252,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/action-msg.json b/test/test-cases/regression/action-msg.json index 6933be8aa5..580131b7d6 100644 --- a/test/test-cases/regression/action-msg.json +++ b/test/test-cases/regression/action-msg.json @@ -28,7 +28,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -36,14 +36,14 @@ "Content-Length":"length\n\r" }, "body":[ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected":{ @@ -86,7 +86,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -94,14 +94,14 @@ "Content-Length":"length\n\r" }, "body":[ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected":{ diff --git a/test/test-cases/regression/action-tag.json b/test/test-cases/regression/action-tag.json index 870297b462..be02717947 100644 --- a/test/test-cases/regression/action-tag.json +++ b/test/test-cases/regression/action-tag.json @@ -28,7 +28,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -36,14 +36,14 @@ "Content-Length":"length\n\r" }, "body":[ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected":{ @@ -86,7 +86,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -94,14 +94,14 @@ "Content-Length":"length\n\r" }, "body":[ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected":{ diff --git a/test/test-cases/regression/action-tnf-base64.json b/test/test-cases/regression/action-tnf-base64.json index 7cb047ce2f..c0cb878714 100644 --- a/test/test-cases/regression/action-tnf-base64.json +++ b/test/test-cases/regression/action-tnf-base64.json @@ -22,7 +22,7 @@ "uri":"/", "method":"POST", "body": [ - "param1=value1¶m2=value2" + "param1=value1¶m2=value2\n" ] }, "response":{ @@ -32,7 +32,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -66,7 +66,7 @@ "uri":"/", "method":"POST", "body": [ - "param1=dmFsdWUy¶m2=value2" + "param1=dmFsdWUy¶m2=value2\n" ] }, "response":{ @@ -76,7 +76,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/action-xmlns.json b/test/test-cases/regression/action-xmlns.json index df612f20c3..dad77a4dfc 100644 --- a/test/test-cases/regression/action-xmlns.json +++ b/test/test-cases/regression/action-xmlns.json @@ -58,40 +58,40 @@ "uri":"/?key=value&key=other_value", "method":"POST", "body": [ - "", - "", - "", - "Everyday Italian", - "Giada De Laurentiis", - "2005", - "30.00", - "", + "\n", + "\n", + "\n", + "Everyday Italian\n", + "Giada De Laurentiis\n", + "2005\n", + "30.00\n", + "\n", - "", - "Harry Potter", - "J K. Rowling", - "2005", - "29.99", - "", + "\n", + "Harry Potter\n", + "J K. Rowling\n", + "2005\n", + "29.99\n", + "\n", - "", - "XQuery Kick Start", - "James McGovern", - "Per Bothner", - "Kurt Cagle", - "James Linn", - "Vaidyanathan Nagarajan", - "2003", - "49.99", - "", + "\n", + "XQuery Kick Start\n", + "James McGovern\n", + "Per Bothner\n", + "Kurt Cagle\n", + "James Linn\n", + "Vaidyanathan Nagarajan\n", + "2003\n", + "49.99\n", + "\n", - "", - "Learning XML", - "Erik T. Ray", - "2003", - "39.95", - "", - "" + "\n", + "Learning XML\n", + "Erik T. Ray\n", + "2003\n", + "39.95\n", + "\n", + "\n" ] }, "server":{ diff --git a/test/test-cases/regression/actions.json b/test/test-cases/regression/actions.json index c69f1a7cb0..9388e7c4ba 100644 --- a/test/test-cases/regression/actions.json +++ b/test/test-cases/regression/actions.json @@ -29,7 +29,7 @@ "uri": "\/test.pl?param1= test ¶m2=test2", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { @@ -37,14 +37,14 @@ "Content-Length": "length\n\r" }, "body": [ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected": { @@ -89,7 +89,7 @@ "uri": "\/test.pl?param1= test ¶m2=test2", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { @@ -97,14 +97,14 @@ "Content-Length": "length\n\r" }, "body": [ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected": { @@ -149,7 +149,7 @@ "uri": "\/test.pl?param1= test ¶m2=test2", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { @@ -157,14 +157,14 @@ "Content-Length": "length\n\r" }, "body": [ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected": { @@ -209,7 +209,7 @@ "uri": "\/test.pl?param1= test ¶m2=test2", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { @@ -217,14 +217,14 @@ "Content-Length": "length\n\r" }, "body": [ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected": { @@ -268,7 +268,7 @@ "uri": "\/test.pl?param1= test ¶m2=test2", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { @@ -276,14 +276,14 @@ "Content-Length": "length\n\r" }, "body": [ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected": { @@ -327,7 +327,7 @@ "uri": "\/test.pl?param1= test ¶m2=test2", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { @@ -335,14 +335,14 @@ "Content-Length": "length\n\r" }, "body": [ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected": { diff --git a/test/test-cases/regression/auditlog.json b/test/test-cases/regression/auditlog.json index 417f9950e4..5c1a23b6b4 100644 --- a/test/test-cases/regression/auditlog.json +++ b/test/test-cases/regression/auditlog.json @@ -28,14 +28,14 @@ "uri": "\/test.pl?param1= test ¶m2=test2", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { "Content-Type": "plain\/text\n\r" }, "body": [ - "test" + "test\n" ] }, "expected": { @@ -85,14 +85,14 @@ "uri": "\/test.pl?param1= test ¶m2=test2", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { "Content-Type": "plain\/text\n\r" }, "body": [ - "test" + "test\n" ] }, "expected": { @@ -143,14 +143,14 @@ "uri": "\/test.pl?param1= test ¶m2=test2", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { "Content-Type": "plain\/text\n\r" }, "body": [ - "test" + "test\n" ] }, "expected": { @@ -201,14 +201,14 @@ "uri": "\/test.pl?param1= test ¶m2=test2", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { "Content-Type": "plain\/text\n\r" }, "body": [ - "test" + "test\n" ] }, "expected": { @@ -260,7 +260,7 @@ "uri": "\/test.pl?param1=test¶m2=test2", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "expected": { "audit_log": "id \"1556", @@ -309,7 +309,7 @@ "uri": "\/test.pl?param1=test¶m2=tEst2", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "expected": { "audit_log": "\\[msg \"testmsg\"\\] \\[data \"testdata\"\\] \\[severity \"7\"\\] \\[ver \"\"\\] \\[maturity \"0\"\\] \\[accuracy \"0\"\\] \\[tag \"testtag1\"\\] \\[tag \"testtag2\"\\]", @@ -358,7 +358,7 @@ "uri": "\/test.pl?param1=test¶m2=%20tEst2", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "expected": { "audit_log": "\\[msg \"testmsg\"\\] \\[data \"testdata\"\\] \\[severity \"7\"\\] \\[ver \"\"\\] \\[maturity \"0\"\\] \\[accuracy \"0\"\\] \\[tag \"testtag1\"\\] \\[tag \"testtag2\"\\]", @@ -407,7 +407,7 @@ "uri": "\/test.pl?param1=test¶m2=tEst2", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "expected": { "audit_log": "\\[msg \"testmsg\"\\] \\[data \"testdata\"\\] \\[severity \"7\"\\] \\[ver \"\"\\] \\[maturity \"0\"\\] \\[accuracy \"0\"\\] \\[tag \"testtag1\"\\] \\[tag \"testtag2\"\\]", @@ -457,7 +457,7 @@ "uri": "\/test.pl?param1=test¶m2=%20tEst2", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "expected": { "audit_log": "\\[msg \"testmsg\"\\] \\[data \"testdata\"\\] \\[severity \"7\"\\] \\[ver \"\"\\] \\[maturity \"0\"\\] \\[accuracy \"0\"\\] \\[tag \"testtag1\"\\] \\[tag \"testtag2\"\\]", @@ -507,14 +507,14 @@ "uri": "\/test.pl?param1= test ¶m2=test2", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { "Content-Type": "plain\/text\n\r" }, "body": [ - "test" + "test\n" ] }, "expected": { @@ -566,14 +566,14 @@ "uri": "\/?%ADd+allow%3d1+%ADd+auto", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { "Content-Type": "plain\/text\n\r" }, "body": [ - "test" + "test\n" ] }, "expected": { @@ -628,7 +628,7 @@ "method": "POST", "http_version": 1.1, "body": [ - "\u00ad=\u00ad" + "\u00ad=\u00ad\n" ] }, "response": { @@ -636,7 +636,7 @@ "Content-Type": "plain\/text\n\r" }, "body": [ - "test" + "test\n" ] }, "expected": { @@ -692,7 +692,7 @@ "method": "POST", "http_version": 1.1, "body": [ - "\u00ad=\u00ad" + "\u00ad=\u00ad\n" ] }, "response": { @@ -700,7 +700,7 @@ "Content-Type": "plain\/text\n\r" }, "body": [ - "test" + "test\n" ] }, "expected": { diff --git a/test/test-cases/regression/collection-case-insensitive.json b/test/test-cases/regression/collection-case-insensitive.json index a2955fd0bb..1d0611af5d 100644 --- a/test/test-cases/regression/collection-case-insensitive.json +++ b/test/test-cases/regression/collection-case-insensitive.json @@ -28,7 +28,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -36,14 +36,14 @@ "Content-Length":"length\n\r" }, "body":[ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected":{ diff --git a/test/test-cases/regression/collection-lua.json b/test/test-cases/regression/collection-lua.json index 8d8f4e129f..794ac44ea6 100644 --- a/test/test-cases/regression/collection-lua.json +++ b/test/test-cases/regression/collection-lua.json @@ -26,7 +26,7 @@ "response":{ "headers":{}, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -68,7 +68,7 @@ "response":{ "headers":{}, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -110,7 +110,7 @@ "response":{ "headers":{}, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -152,7 +152,7 @@ "response":{ "headers":{}, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -194,7 +194,7 @@ "response":{ "headers":{}, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -236,7 +236,7 @@ "response":{ "headers":{}, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -278,7 +278,7 @@ "response":{ "headers":{}, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/collection-regular_expression_selection.json b/test/test-cases/regression/collection-regular_expression_selection.json index 137b391030..ef8f0ce4c7 100644 --- a/test/test-cases/regression/collection-regular_expression_selection.json +++ b/test/test-cases/regression/collection-regular_expression_selection.json @@ -28,7 +28,7 @@ "uri":"\/test.pl?id_a=test&nah=nops", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -36,14 +36,14 @@ "Content-Length":"length\n\r" }, "body":[ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected":{ @@ -88,7 +88,7 @@ "uri":"\/test.pl?id_a=test&nah=nops", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -96,14 +96,14 @@ "Content-Length":"length\n\r" }, "body":[ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected":{ diff --git a/test/test-cases/regression/collection-resource.json b/test/test-cases/regression/collection-resource.json index 2652ca493c..728eef7822 100644 --- a/test/test-cases/regression/collection-resource.json +++ b/test/test-cases/regression/collection-resource.json @@ -28,7 +28,7 @@ "uri":"\/test.pl?resource=whee", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -80,7 +80,7 @@ "uri":"\/test.pl?resource=whee", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ diff --git a/test/test-cases/regression/collection-tx-with-macro.json b/test/test-cases/regression/collection-tx-with-macro.json index 3b4bd1e1f8..6fa6863f77 100644 --- a/test/test-cases/regression/collection-tx-with-macro.json +++ b/test/test-cases/regression/collection-tx-with-macro.json @@ -28,7 +28,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -36,14 +36,14 @@ "Content-Length":"length\n\r" }, "body":[ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected":{ @@ -86,7 +86,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -94,14 +94,14 @@ "Content-Length":"length\n\r" }, "body":[ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected":{ @@ -144,7 +144,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -152,14 +152,14 @@ "Content-Length":"length\n\r" }, "body":[ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected":{ @@ -203,7 +203,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -211,14 +211,14 @@ "Content-Length":"length\n\r" }, "body":[ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected":{ diff --git a/test/test-cases/regression/collection-tx.json b/test/test-cases/regression/collection-tx.json index dc78f5fc3b..0a72e1b271 100644 --- a/test/test-cases/regression/collection-tx.json +++ b/test/test-cases/regression/collection-tx.json @@ -19,14 +19,14 @@ "uri":"/", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ "Content-Type":"text/xml; charset=utf-8\n" }, "body":[ - "\n" + "\n\n" ] }, "expected":{ @@ -67,7 +67,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -75,14 +75,14 @@ "Content-Length":"length\n\r" }, "body":[ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected":{ @@ -125,7 +125,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -133,14 +133,14 @@ "Content-Length":"length\n\r" }, "body":[ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected":{ @@ -183,7 +183,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -191,14 +191,14 @@ "Content-Length":"length\n\r" }, "body":[ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected":{ @@ -242,7 +242,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -250,14 +250,14 @@ "Content-Length":"length\n\r" }, "body":[ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected":{ @@ -303,7 +303,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -311,14 +311,14 @@ "Content-Length":"length\n\r" }, "body":[ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected":{ diff --git a/test/test-cases/regression/config-body_limits.json b/test/test-cases/regression/config-body_limits.json index 07db589acc..3553b9f43d 100644 --- a/test/test-cases/regression/config-body_limits.json +++ b/test/test-cases/regression/config-body_limits.json @@ -27,7 +27,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -67,7 +67,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -100,21 +100,21 @@ "uri":"/?key=value&key=other_value", "method":"POST", "body":[ - "--------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "--------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "--------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "--------------------------756b6d74fa1a8ee2--" + "--------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "--------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "--------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "--------------------------756b6d74fa1a8ee2--\n" ] }, "response":{ @@ -124,7 +124,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -157,21 +157,21 @@ "uri":"/?key=value&key=other_value", "method":"POST", "body":[ - "--------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "--------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "--------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "--------------------------756b6d74fa1a8ee2--" + "--------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "--------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "--------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "--------------------------756b6d74fa1a8ee2--\n" ] }, "response":{ @@ -181,7 +181,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -214,21 +214,21 @@ "uri":"/?key=value&key=other_value", "method":"POST", "body":[ - "--------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "--------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "--------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "--------------------------756b6d74fa1a8ee2--" + "--------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "--------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "--------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "--------------------------756b6d74fa1a8ee2--\n" ] }, "response":{ @@ -238,7 +238,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -273,21 +273,21 @@ "uri":"/?key=value&key=other_value", "method":"POST", "body":[ - "--------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "--------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "--------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "--------------------------756b6d74fa1a8ee2--" + "--------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "--------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "--------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "--------------------------756b6d74fa1a8ee2--\n" ] }, "response":{ @@ -297,7 +297,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -332,7 +332,7 @@ "uri":"/", "method":"POST", "body": [ - "a=bad_value" + "a=bad_value\n" ] }, "response":{ @@ -342,7 +342,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -379,7 +379,7 @@ "uri":"/", "method":"POST", "body": [ - "aa=bad_value" + "aa=bad_value\n" ] }, "response":{ @@ -389,7 +389,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -426,7 +426,7 @@ "uri":"/", "method":"POST", "body": [ - "{\"a\":\"bad_value\"}" + "{\"a\":\"bad_value\"}\n" ] }, "response":{ @@ -436,7 +436,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -475,7 +475,7 @@ "uri":"/", "method":"POST", "body": [ - "{\"a\":\"bad_value\"}" + "{\"a\":\"bad_value\"}\n" ] }, "response":{ @@ -485,7 +485,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -524,7 +524,7 @@ "uri":"/", "method":"POST", "body": [ - "{\"a\":1}}" + "{\"a\":1}}\n" ] }, "response":{ @@ -534,7 +534,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -573,7 +573,7 @@ "uri":"/", "method":"POST", "body": [ - "{\"a\":1}}" + "{\"a\":1}}\n" ] }, "response":{ @@ -583,7 +583,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -622,7 +622,7 @@ "uri":"/", "method":"POST", "body": [ - "{\"a\":1}}" + "{\"a\":1}}\n" ] }, "response":{ @@ -632,7 +632,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -672,7 +672,7 @@ "uri":"/", "method":"POST", "body": [ - "bad_value" + "bad_value\n" ] }, "response":{ @@ -682,7 +682,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -722,7 +722,7 @@ "uri":"/", "method":"POST", "body": [ - "bad_value" + "bad_value\n" ] }, "response":{ @@ -732,7 +732,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -772,7 +772,7 @@ "uri":"/", "method":"POST", "body": [ - "" + "\n" ] }, "response":{ @@ -782,7 +782,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -821,7 +821,7 @@ "uri":"/", "method":"POST", "body": [ - "" + "\n" ] }, "response":{ @@ -831,7 +831,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -870,7 +870,7 @@ "uri":"/", "method":"POST", "body": [ - "" + "\n" ] }, "response":{ @@ -880,7 +880,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -924,7 +924,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -964,7 +964,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -999,7 +999,7 @@ "uri":"/", "method":"POST", "body": [ - "param1=value1¶m2=value2¶m3=value3" + "param1=value1¶m2=value2¶m3=value3\n" ] }, "response":{ @@ -1009,7 +1009,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -1046,7 +1046,7 @@ "uri":"/", "method":"POST", "body": [ - "param1=value1¶m2=value2¶m3=value3" + "param1=value1¶m2=value2¶m3=value3\n" ] }, "response":{ @@ -1056,7 +1056,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -1092,7 +1092,7 @@ "uri":"/", "method":"POST", "body": [ - "{\"param1\":{\"param2\":\"value2\",\"param3\":\"value3\"}}" + "{\"param1\":{\"param2\":\"value2\",\"param3\":\"value3\"}}\n" ] }, "response":{ @@ -1102,7 +1102,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -1140,7 +1140,7 @@ "uri":"/", "method":"POST", "body": [ - "{\"param1\":{\"param2\":\"value2\",\"param3\":\"value3\"}}" + "{\"param1\":{\"param2\":\"value2\",\"param3\":\"value3\"}}\n" ] }, "response":{ @@ -1150,7 +1150,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -1188,7 +1188,7 @@ "uri":"/", "method":"POST", "body": [ - "ccceee" + "ccceee\n" ] }, "response":{ @@ -1198,7 +1198,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -1237,7 +1237,7 @@ "uri":"/", "method":"POST", "body": [ - "ccceee" + "ccceee\n" ] }, "response":{ @@ -1247,7 +1247,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -1284,15 +1284,15 @@ "uri":"/", "method":"POST", "body": [ - "--0000", - "Content-Disposition: form-data; name=\"a\"", - "", - "1", - "--0000", - "Content-Disposition: form-data; name=\"b\"; filename=\"c.txt\"", - "", - "2222222222222222222222222222222222222222222222222222222222222222222222", - "--0000--" + "--0000\n", + "Content-Disposition: form-data; name=\"a\"\n", + "\n", + "1\n", + "--0000\n", + "Content-Disposition: form-data; name=\"b\"; filename=\"c.txt\"\n", + "\n", + "2222222222222222222222222222222222222222222222222222222222222222222222\n", + "--0000--\n" ] }, "response":{ @@ -1302,7 +1302,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -1339,15 +1339,15 @@ "uri":"/", "method":"POST", "body": [ - "--0000", - "Content-Disposition: form-data; name=\"a\"", - "", - "1", - "--0000", - "Content-Disposition: form-data; name=\"b\"; filename=\"c.txt\"", - "", - "2222222222222222222222222222222222222222222222222222222222222222222222", - "--0000--" + "--0000\n", + "Content-Disposition: form-data; name=\"a\"\n", + "\n", + "1\n", + "--0000\n", + "Content-Disposition: form-data; name=\"b\"; filename=\"c.txt\"\n", + "\n", + "2222222222222222222222222222222222222222222222222222222222222222222222\n", + "--0000--\n" ] }, "response":{ @@ -1357,7 +1357,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/config-calling_phases_by_name.json b/test/test-cases/regression/config-calling_phases_by_name.json index 39bd6f46d2..187776af48 100644 --- a/test/test-cases/regression/config-calling_phases_by_name.json +++ b/test/test-cases/regression/config-calling_phases_by_name.json @@ -27,7 +27,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -67,7 +67,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/config-include.json b/test/test-cases/regression/config-include.json index ab73de0760..df6ac15cf4 100644 --- a/test/test-cases/regression/config-include.json +++ b/test/test-cases/regression/config-include.json @@ -27,7 +27,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -67,7 +67,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -107,7 +107,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -147,7 +147,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -187,7 +187,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -228,7 +228,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -268,7 +268,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -308,7 +308,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/config-remove_by_id.json b/test/test-cases/regression/config-remove_by_id.json index 9f074420b8..0fd95ff7e0 100644 --- a/test/test-cases/regression/config-remove_by_id.json +++ b/test/test-cases/regression/config-remove_by_id.json @@ -27,7 +27,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -68,7 +68,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -109,7 +109,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/config-remove_by_msg.json b/test/test-cases/regression/config-remove_by_msg.json index 36cb3cab06..bfd73c2920 100644 --- a/test/test-cases/regression/config-remove_by_msg.json +++ b/test/test-cases/regression/config-remove_by_msg.json @@ -27,7 +27,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -68,7 +68,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/config-remove_by_tag.json b/test/test-cases/regression/config-remove_by_tag.json index 09681546ac..c9f77c3cfa 100644 --- a/test/test-cases/regression/config-remove_by_tag.json +++ b/test/test-cases/regression/config-remove_by_tag.json @@ -27,7 +27,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -68,7 +68,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/config-response_type.json b/test/test-cases/regression/config-response_type.json index 621ab38a20..1b0bcfad92 100644 --- a/test/test-cases/regression/config-response_type.json +++ b/test/test-cases/regression/config-response_type.json @@ -27,7 +27,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -68,7 +68,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -109,7 +109,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/config-secdefaultaction.json b/test/test-cases/regression/config-secdefaultaction.json index bb3d7d8104..980fee3148 100644 --- a/test/test-cases/regression/config-secdefaultaction.json +++ b/test/test-cases/regression/config-secdefaultaction.json @@ -28,7 +28,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -36,14 +36,14 @@ "Content-Length":"length\n\r" }, "body":[ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected":{ @@ -87,7 +87,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -95,14 +95,14 @@ "Content-Length":"length\n\r" }, "body":[ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected":{ @@ -161,7 +161,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -169,14 +169,14 @@ "Content-Length":"length\n\r" }, "body":[ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected":{ @@ -252,7 +252,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -260,14 +260,14 @@ "Content-Length":"length\n\r" }, "body":[ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected":{ diff --git a/test/test-cases/regression/config-secremoterules.json b/test/test-cases/regression/config-secremoterules.json index 5065e06b64..c9e444df2e 100644 --- a/test/test-cases/regression/config-secremoterules.json +++ b/test/test-cases/regression/config-secremoterules.json @@ -28,7 +28,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -83,7 +83,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/config-update-action-by-id.json b/test/test-cases/regression/config-update-action-by-id.json index 4e1a3fc24e..0f06d45a4b 100644 --- a/test/test-cases/regression/config-update-action-by-id.json +++ b/test/test-cases/regression/config-update-action-by-id.json @@ -30,7 +30,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -75,7 +75,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -117,7 +117,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -162,7 +162,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -208,7 +208,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -255,7 +255,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/config-update-target-by-id.json b/test/test-cases/regression/config-update-target-by-id.json index 8faecaefe6..718ed71952 100644 --- a/test/test-cases/regression/config-update-target-by-id.json +++ b/test/test-cases/regression/config-update-target-by-id.json @@ -27,7 +27,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -67,7 +67,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -107,7 +107,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -147,7 +147,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -187,7 +187,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/config-update-target-by-msg.json b/test/test-cases/regression/config-update-target-by-msg.json index 24fe343cd0..28673ed79f 100644 --- a/test/test-cases/regression/config-update-target-by-msg.json +++ b/test/test-cases/regression/config-update-target-by-msg.json @@ -27,7 +27,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/config-update-target-by-tag.json b/test/test-cases/regression/config-update-target-by-tag.json index 10d4c1b487..59cf702c5e 100644 --- a/test/test-cases/regression/config-update-target-by-tag.json +++ b/test/test-cases/regression/config-update-target-by-tag.json @@ -27,7 +27,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -67,7 +67,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -107,7 +107,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -147,7 +147,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -187,7 +187,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -227,7 +227,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -267,7 +267,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/config-xml_external_entity.json b/test/test-cases/regression/config-xml_external_entity.json index 1f5cf098dc..fa328d302d 100644 --- a/test/test-cases/regression/config-xml_external_entity.json +++ b/test/test-cases/regression/config-xml_external_entity.json @@ -22,14 +22,14 @@ "uri":"/?key=value&key=other_value", "method":"POST", "body": [ - "", - "", - "", - "]>", - "", - " &js;", - "" + "\n", + "\n", + "\n", + "]>\n", + "\n", + " &js;\n", + "\n" ] }, @@ -69,14 +69,14 @@ "uri":"/?key=value&key=other_value", "method":"POST", "body": [ - "", - "", - "", - "]>", - "", - " &js;", - "" + "\n", + "\n", + "\n", + "]>\n", + "\n", + " &js;\n", + "\n" ] }, @@ -117,14 +117,14 @@ "uri":"/?key=value&key=other_value", "method":"POST", "body": [ - "", - "", - "", - "]>", - "", - " &js;", - "" + "\n", + "\n", + "\n", + "]>\n", + "\n", + " &js;\n", + "\n" ] }, diff --git a/test/test-cases/regression/debug_log.json b/test/test-cases/regression/debug_log.json index 9e17fac69e..c3ba716211 100644 --- a/test/test-cases/regression/debug_log.json +++ b/test/test-cases/regression/debug_log.json @@ -29,7 +29,7 @@ "uri": "\/test.pl?param1=test¶2=test2", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { @@ -37,14 +37,14 @@ "Content-Length": "length\n\r" }, "body": [ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected": { diff --git a/test/test-cases/regression/directive-sec_rule_script.json b/test/test-cases/regression/directive-sec_rule_script.json index b8eb904759..9274d6db23 100644 --- a/test/test-cases/regression/directive-sec_rule_script.json +++ b/test/test-cases/regression/directive-sec_rule_script.json @@ -29,7 +29,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -78,7 +78,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -127,7 +127,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ @@ -177,7 +177,7 @@ "uri":"\/test.pl?param1= test ¶m2=test2", "method":"GET", "http_version":1.1, - "body":"" + "body":"\n" }, "response":{ "headers":{ diff --git a/test/test-cases/regression/fn-setHostname.json b/test/test-cases/regression/fn-setHostname.json index 59c5b52e8f..0b8d5f416e 100644 --- a/test/test-cases/regression/fn-setHostname.json +++ b/test/test-cases/regression/fn-setHostname.json @@ -25,7 +25,7 @@ "Content-Type":"text/plain" }, "body":[ - "denystring" + "denystring\n" ] }, "expected":{ diff --git a/test/test-cases/regression/issue-1152.json b/test/test-cases/regression/issue-1152.json index 54c78f7991..ec4ed37a1e 100644 --- a/test/test-cases/regression/issue-1152.json +++ b/test/test-cases/regression/issue-1152.json @@ -30,7 +30,7 @@ "uri": "\/test.pl?foo=bar", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { @@ -78,7 +78,7 @@ "uri": "\/test.pl?foo=bar", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { @@ -128,7 +128,7 @@ "uri": "\/test.pl?foo=bar", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { @@ -178,7 +178,7 @@ "uri": "\/test.pl?a=test&b=test&c=test&d=test", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { diff --git a/test/test-cases/regression/issue-1528.json b/test/test-cases/regression/issue-1528.json index f2257055c2..27da6a8a5f 100644 --- a/test/test-cases/regression/issue-1528.json +++ b/test/test-cases/regression/issue-1528.json @@ -17,13 +17,13 @@ "request": { "uri":"/?param=attack", "headers": "", - "body": "", + "body": "\n", "method": "GET", "http_version": 1.1 }, "response": { "headers": "", - "body": "" + "body": "\n" }, "expected": { "debug_log": "Rule returned 1", diff --git a/test/test-cases/regression/issue-1565.json b/test/test-cases/regression/issue-1565.json index 6596404f17..74d2da8224 100644 --- a/test/test-cases/regression/issue-1565.json +++ b/test/test-cases/regression/issue-1565.json @@ -21,13 +21,13 @@ "Accept":"*/*", "Content-Length": "1539" }, - "body": "", + "body": "\n", "method": "GET", "http_version": 1.1 }, "response": { "headers": "", - "body": "" + "body": "\n" }, "expected": { "debug_log": "Rule returned 0." @@ -59,13 +59,13 @@ "Accept":"*/*", "Content-Length": "1539" }, - "body": "", + "body": "\n", "method": "GET", "http_version": 1.1 }, "response": { "headers": "", - "body": "" + "body": "\n" }, "expected": { "debug_log": "Rule returned 1" diff --git a/test/test-cases/regression/issue-1576.json b/test/test-cases/regression/issue-1576.json index eb41e1dfb6..8226f84c5a 100644 --- a/test/test-cases/regression/issue-1576.json +++ b/test/test-cases/regression/issue-1576.json @@ -20,17 +20,17 @@ "uri":"/?key=value&key=other_value", "method":"POST", "body": [ - "{", - " \"foo\":\"bar\",", - " \"mod\":\"sec\",", - " \"ops\": [", - " [\"um\", \"um e meio\"], ", - " \"dois\",", - " \"tres\",", - " { \"eins\": [\"zwei\", \"drei\"] }", - " ],", - " \"whee\": \"lhebs\"", - "}" + "{\n", + " \"foo\":\"bar\",\n", + " \"mod\":\"sec\",\n", + " \"ops\": [\n", + " [\"um\", \"um e meio\"], \n", + " \"dois\",\n", + " \"tres\",\n", + " { \"eins\": [\"zwei\", \"drei\"] }\n", + " ],\n", + " \"whee\": \"lhebs\"\n", + "}\n" ] }, "server":{ @@ -68,11 +68,11 @@ "uri":"/?key=value&key=other_value", "method":"POST", "body": [ - "[", - " \"one\",", - " \"two\",", - " \"three\"", - "]" + "[\n", + " \"one\",\n", + " \"two\",\n", + " \"three\"\n", + "]\n" ] }, "server":{ @@ -110,20 +110,20 @@ "uri":"/?key=value&key=other_value", "method":"POST", "body": [ - "{", - " \"foo\":\"bar\",", - " \"mod\":\"sec\",", - " \"ops\": {", - " \"um\": \"um e meio\", ", - " \"dois\": \"tres\",", - " \"quatro\": \"cinco\",", - " \"seis\": {", - " \"dez\": \"onze\",", - " \"doze\": \"treze\"", - " }", - " },", - " \"whee\": \"lhebs\"", - "}" + "{\n", + " \"foo\":\"bar\",\n", + " \"mod\":\"sec\",\n", + " \"ops\": {\n", + " \"um\": \"um e meio\", \n", + " \"dois\": \"tres\",\n", + " \"quatro\": \"cinco\",\n", + " \"seis\": {\n", + " \"dez\": \"onze\",\n", + " \"doze\": \"treze\"\n", + " }\n", + " },\n", + " \"whee\": \"lhebs\"\n", + "}\n" ] }, "server":{ diff --git a/test/test-cases/regression/issue-1591.json b/test/test-cases/regression/issue-1591.json index 2b32aa29a2..52caa278a0 100644 --- a/test/test-cases/regression/issue-1591.json +++ b/test/test-cases/regression/issue-1591.json @@ -22,13 +22,13 @@ "Content-Length": "1539", "Cookie": "__utma=1.32168570.12572608.1259628772.2&__utmb=1.4.10.1259628772&" }, - "body": "", + "body": "\n", "method": "GET", "http_version": 1.1 }, "response": { "headers": "", - "body": "" + "body": "\n" }, "expected": { "debug_log": "Rule returned 0." @@ -61,13 +61,13 @@ "Content-Length": "1539", "Cookie": "__utma=1.32168570.12572608.1259628772.2&__utmb=1.4.10.1259628772&" }, - "body": "", + "body": "\n", "method": "GET", "http_version": 1.1 }, "response": { "headers": "", - "body": "" + "body": "\n" }, "expected": { "debug_log": "Rule returned 1." @@ -100,13 +100,13 @@ "Content-Length": "1539", "Cookie": "__utma=1.32168570.12572608.1259628772.2&__utmb=1.4.10.1259628772&" }, - "body": "", + "body": "\n", "method": "GET", "http_version": 1.1 }, "response": { "headers": "", - "body": "" + "body": "\n" }, "expected": { "debug_log": "Variable: REQUEST_HEADERS:Content-Length" diff --git a/test/test-cases/regression/issue-1725.json b/test/test-cases/regression/issue-1725.json index afd7c794e2..90c4edb2d3 100644 --- a/test/test-cases/regression/issue-1725.json +++ b/test/test-cases/regression/issue-1725.json @@ -22,14 +22,14 @@ "Content-Length": "1539", "Cookie": "__utma=1.32168570.12572608.1259628772.2&__utmb=1.4.10.1259628772&" }, - "body": "", + "body": "\n", "method": "GET", "http_version": 1.1, "uri": "/test" }, "response": { "headers": "", - "body": "" + "body": "\n" }, "expected": { "debug_log": "\/test; 0.[0-9]+; 0.[0-9]+;" diff --git a/test/test-cases/regression/issue-1743.json b/test/test-cases/regression/issue-1743.json index 5e2b2fad35..b2d9aba7f2 100644 --- a/test/test-cases/regression/issue-1743.json +++ b/test/test-cases/regression/issue-1743.json @@ -17,13 +17,13 @@ "request": { "uri":"/?x=foo%3d", "headers": "", - "body": "", + "body": "\n", "method": "GET", "http_version": 1.1 }, "response": { "headers": "", - "body": "" + "body": "\n" }, "expected": { "debug_log": "Rule returned 1", @@ -53,13 +53,13 @@ "request": { "uri":"/?x=foo=", "headers": "", - "body": "", + "body": "\n", "method": "GET", "http_version": 1.1 }, "response": { "headers": "", - "body": "" + "body": "\n" }, "expected": { "debug_log": "Rule returned 1", diff --git a/test/test-cases/regression/issue-1785.json b/test/test-cases/regression/issue-1785.json index ba252b144f..0cc3aaf6b8 100644 --- a/test/test-cases/regression/issue-1785.json +++ b/test/test-cases/regression/issue-1785.json @@ -30,7 +30,7 @@ "uri": "\/test.pl?foo=bar", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { diff --git a/test/test-cases/regression/issue-1812.json b/test/test-cases/regression/issue-1812.json index 47c51933bd..6dd106cb67 100644 --- a/test/test-cases/regression/issue-1812.json +++ b/test/test-cases/regression/issue-1812.json @@ -30,7 +30,7 @@ "uri": "\/test.pl?foo=£&bar=%C2%A3", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { diff --git a/test/test-cases/regression/issue-1825.json b/test/test-cases/regression/issue-1825.json index 40a0c128ed..29f8bc259f 100644 --- a/test/test-cases/regression/issue-1825.json +++ b/test/test-cases/regression/issue-1825.json @@ -23,21 +23,21 @@ "uri":"/", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"03CB1664.txt\"; filename*=utf-8''03CB1664.txt", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"03CB1664.txt\"; filename*=utf-8''03CB1664.txt\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "response":{ "headers":"", - "body":"" + "body":"\n" }, "expected":{ "debug_log":"Target value: \"03CB1664.txt\" \\(Variable: MULTIPART_FILENAME" @@ -71,21 +71,21 @@ "uri":"/", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename*= ISO-8859-1''ab0-_xy.txt; filename=\"ab0-_xy.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename*= ISO-8859-1''ab0-_xy.txt; filename=\"ab0-_xy.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "response":{ "headers":"", - "body":"" + "body":"\n" }, "expected":{ "debug_log":"Target value: \"ab0-_xy.txt\" \\(Variable: MULTIPART_FILENAME" @@ -119,21 +119,21 @@ "uri":"/", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename*=utf-8''03CB1664.txt", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2--\r" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename*=utf-8''03CB1664.txt\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\r\n" ] }, "response":{ "headers":"", - "body":"" + "body":"\n" }, "expected":{ "debug_log":"Warning: no filename= but filename*" @@ -167,21 +167,21 @@ "uri":"/", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"03CB1664.txt\"; filename*=''03CB1664.txt", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"03CB1664.txt\"; filename*=''03CB1664.txt\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "response":{ "headers":"", - "body":"" + "body":"\n" }, "expected":{ "debug_log":"Multipart: Invalid Content-Disposition header \\(-16" @@ -215,21 +215,21 @@ "uri":"/", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"03CB1664.txt\"; filename*=UTF-8'03CB1664.txt", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"03CB1664.txt\"; filename*=UTF-8'03CB1664.txt\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "response":{ "headers":"", - "body":"" + "body":"\n" }, "expected":{ "debug_log":"Multipart: Invalid Content-Disposition header \\(-17" @@ -263,21 +263,21 @@ "uri":"/", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"03CB1664.txt\"; filename*=utf-8''%61%4G.txt", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"03CB1664.txt\"; filename*=utf-8''%61%4G.txt\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "response":{ "headers":"", - "body":"" + "body":"\n" }, "expected":{ "debug_log":"Multipart: Invalid Content-Disposition header \\(-18" @@ -311,21 +311,21 @@ "uri":"/", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"03CB1664.txt\"; filename*=utf-8''%61%62.txt", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"03CB1664.txt\"; filename*=utf-8''%61%62.txt\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "response":{ "headers":"", - "body":"" + "body":"\n" }, "expected":{ "http_code":200 diff --git a/test/test-cases/regression/issue-1831.json b/test/test-cases/regression/issue-1831.json index 773a0eec97..5db54fcb2e 100644 --- a/test/test-cases/regression/issue-1831.json +++ b/test/test-cases/regression/issue-1831.json @@ -30,7 +30,7 @@ "uri": "\/test.pl?foo=£&bar=%C2%A3", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { @@ -77,7 +77,7 @@ "uri": "\/test.pl?foo=£&bar=%C2%A3", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { @@ -127,7 +127,7 @@ "uri": "\/test.pl?foo=£&bar=%C2%A3", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { @@ -176,7 +176,7 @@ "uri": "\/test.pl?foo=£&bar=%C2%A3", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { diff --git a/test/test-cases/regression/issue-1844.json b/test/test-cases/regression/issue-1844.json index 6ccb1f5e8a..b6db9f3c25 100644 --- a/test/test-cases/regression/issue-1844.json +++ b/test/test-cases/regression/issue-1844.json @@ -23,7 +23,7 @@ "uri":"/", "method":"POST", "body": [ - "param1=test1¶m2=value2" + "param1=test1¶m2=value2\n" ] }, "response":{ @@ -33,7 +33,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -69,7 +69,7 @@ "uri":"/", "method":"POST", "body": [ - "param1=test2" + "param1=test2\n" ] }, "response":{ @@ -79,7 +79,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -115,7 +115,7 @@ "uri":"/", "method":"POST", "body": [ - "param1=test3" + "param1=test3\n" ] }, "response":{ @@ -125,7 +125,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -161,7 +161,7 @@ "uri":"/", "method":"POST", "body": [ - "param1=test4" + "param1=test4\n" ] }, "response":{ @@ -171,7 +171,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -207,7 +207,7 @@ "uri":"/", "method":"POST", "body": [ - "param1=test5" + "param1=test5\n" ] }, "response":{ @@ -217,7 +217,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -253,7 +253,7 @@ "uri":"/", "method":"POST", "body": [ - "param1=test5" + "param1=test5\n" ] }, "response":{ @@ -263,7 +263,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/issue-1850.json b/test/test-cases/regression/issue-1850.json index 75ac2bc5f6..039c0412f4 100644 --- a/test/test-cases/regression/issue-1850.json +++ b/test/test-cases/regression/issue-1850.json @@ -30,7 +30,7 @@ "uri": "\/test.pl?foo=£&bar=%C2%A3", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { diff --git a/test/test-cases/regression/issue-1941.json b/test/test-cases/regression/issue-1941.json index 0410ddad84..1ad87ea606 100644 --- a/test/test-cases/regression/issue-1941.json +++ b/test/test-cases/regression/issue-1941.json @@ -71,7 +71,7 @@ "uri": "\/test.pl?param1= test ¶m2=test2&pparam=дор", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { @@ -79,14 +79,14 @@ "Content-Length": "length\n\r" }, "body": [ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected": { @@ -129,7 +129,7 @@ "uri": "\/test.pl?param1= test ¶m2=test2&pparam=дор", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { @@ -137,14 +137,14 @@ "Content-Length": "length\n\r" }, "body": [ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected": { diff --git a/test/test-cases/regression/issue-1943.json b/test/test-cases/regression/issue-1943.json index 7dd688d556..00b2661e7c 100644 --- a/test/test-cases/regression/issue-1943.json +++ b/test/test-cases/regression/issue-1943.json @@ -29,7 +29,7 @@ "uri": "\/test.pl?param1= test ¶m2=test2&pparam=дор", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { @@ -37,14 +37,14 @@ "Content-Length": "length\n\r" }, "body": [ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected": { @@ -86,7 +86,7 @@ "uri": "\/test.pl?param1= test ¶m2=test2&pparam=дор", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { @@ -94,14 +94,14 @@ "Content-Length": "length\n\r" }, "body": [ - "\n\r", - "\n\r", - " \n\r", - " \n\r", - " string<\/EnlightenResult>\n\r", - " <\/EnlightenResponse>\n\r", - " <\/soap:Body>\n\r", - "<\/soap:Envelope>\n\r" + "\n\r\n", + "\n\r\n", + " \n\r\n", + " \n\r\n", + " string<\/EnlightenResult>\n\r\n", + " <\/EnlightenResponse>\n\r\n", + " <\/soap:Body>\n\r\n", + "<\/soap:Envelope>\n\r\n" ] }, "expected": { diff --git a/test/test-cases/regression/issue-1956.json b/test/test-cases/regression/issue-1956.json index ead45da2a0..5afb22a398 100644 --- a/test/test-cases/regression/issue-1956.json +++ b/test/test-cases/regression/issue-1956.json @@ -19,13 +19,13 @@ "Host": "www.google.com" }, "uri": "\/test.pl?param1= test ¶m2=)", - "body": "", + "body": "\n", "method": "GET", "http_version": 1.1 }, "response": { "headers": "", - "body": "" + "body": "\n" }, "expected": { "audit_log": "", @@ -57,13 +57,13 @@ "Host": "www.google.com" }, "uri": "\/test.pl?param1= test ¶m2=)", - "body": "", + "body": "\n", "method": "GET", "http_version": 1.1 }, "response": { "headers": "", - "body": "" + "body": "\n" }, "expected": { "audit_log": "", @@ -95,13 +95,13 @@ "Host": "www.google.com" }, "uri": "\/test.pl?param1= test ¶m2=)", - "body": "", + "body": "\n", "method": "GET", "http_version": 1.1 }, "response": { "headers": "", - "body": "" + "body": "\n" }, "expected": { "audit_log": "", @@ -133,13 +133,13 @@ "Host": "www.google.com" }, "uri": "\/test.pl?param1= test ¶m2=)", - "body": "", + "body": "\n", "method": "GET", "http_version": 1.1 }, "response": { "headers": "", - "body": "" + "body": "\n" }, "expected": { "audit_log": "", @@ -171,13 +171,13 @@ "Host": "www.google.com" }, "uri": "\/test.pl?param1= test ¶m2=)", - "body": "", + "body": "\n", "method": "GET", "http_version": 1.1 }, "response": { "headers": "", - "body": "" + "body": "\n" }, "expected": { "audit_log": "", diff --git a/test/test-cases/regression/issue-1960.json b/test/test-cases/regression/issue-1960.json index 5b288977cd..fd7235da31 100644 --- a/test/test-cases/regression/issue-1960.json +++ b/test/test-cases/regression/issue-1960.json @@ -25,7 +25,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/issue-2000.json b/test/test-cases/regression/issue-2000.json index 05610b457d..6b508d88a0 100644 --- a/test/test-cases/regression/issue-2000.json +++ b/test/test-cases/regression/issue-2000.json @@ -18,7 +18,7 @@ }, "uri":"index.php?foo=bar&a=xxx", "method":"GET", - "body": "" + "body": "\n" }, "expected": { "http_code": 403, diff --git a/test/test-cases/regression/issue-2099.json b/test/test-cases/regression/issue-2099.json index ee43f8e56b..2566e70f3f 100644 --- a/test/test-cases/regression/issue-2099.json +++ b/test/test-cases/regression/issue-2099.json @@ -18,7 +18,7 @@ }, "uri":"/remote.php/webdav?bar=foo", "method":"GET", - "body": "" + "body": "\n" }, "server":{ "ip":"200.249.12.31", @@ -50,7 +50,7 @@ }, "uri":"/remote.php?bar=foo", "method":"GET", - "body": "" + "body": "\n" }, "server":{ "ip":"200.249.12.31", @@ -82,7 +82,7 @@ }, "uri":"/remote.php/webdav?bar=foo", "method":"GET", - "body": "" + "body": "\n" }, "server":{ "ip":"200.249.12.31", @@ -114,7 +114,7 @@ }, "uri":"/remote.php?bar=foo", "method":"GET", - "body": "" + "body": "\n" }, "server":{ "ip":"200.249.12.31", @@ -146,7 +146,7 @@ }, "uri":"/test.php?a=a", "method":"GET", - "body": "" + "body": "\n" }, "server":{ "ip":"200.249.12.31", @@ -178,7 +178,7 @@ }, "uri":"/index.php?a=a", "method":"GET", - "body": "" + "body": "\n" }, "server":{ "ip":"200.249.12.31", diff --git a/test/test-cases/regression/issue-2111.json b/test/test-cases/regression/issue-2111.json index c3faa7d216..6b9e0c494d 100644 --- a/test/test-cases/regression/issue-2111.json +++ b/test/test-cases/regression/issue-2111.json @@ -18,7 +18,7 @@ }, "uri":"index.php?foo=bar&z=xxx", "method":"GET", - "body": "" + "body": "\n" }, "server":{ "ip":"127.0.0.1", diff --git a/test/test-cases/regression/issue-2196.json b/test/test-cases/regression/issue-2196.json index 44347bd08d..58ef9c15ba 100644 --- a/test/test-cases/regression/issue-2196.json +++ b/test/test-cases/regression/issue-2196.json @@ -18,7 +18,7 @@ }, "uri":"index.php?foo=bar&a=xxx", "method":"GET", - "body": "" + "body": "\n" }, "expected": { "http_code": 200, diff --git a/test/test-cases/regression/issue-2296.json b/test/test-cases/regression/issue-2296.json index bc64d19bd2..0f3b674c45 100644 --- a/test/test-cases/regression/issue-2296.json +++ b/test/test-cases/regression/issue-2296.json @@ -29,7 +29,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -72,7 +72,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -115,7 +115,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -158,7 +158,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -202,7 +202,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -245,7 +245,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -289,7 +289,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -333,7 +333,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -376,7 +376,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -418,7 +418,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/issue-2427.json b/test/test-cases/regression/issue-2427.json index 52d2c9e254..b31949319b 100644 --- a/test/test-cases/regression/issue-2427.json +++ b/test/test-cases/regression/issue-2427.json @@ -24,25 +24,25 @@ "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name2\"", - "", - "test2", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"small2.txt\" ", - "Content-Type: text/plain", - "", - "This is another very small test file that contains the search content abcdef..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name2\"\n", + "\n", + "test2\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"small2.txt\" \n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file that contains the search content abcdef..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "expected":{ @@ -84,25 +84,25 @@ "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name2\"", - "", - "test2", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"small2.txt\" ", - "Content-Type: text/plain", - "", - "This is another very small test file that does not contain the search content.", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name2\"\n", + "\n", + "test2\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"small2.txt\" \n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file that does not contain the search content.\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "expected":{ diff --git a/test/test-cases/regression/issue-3340.json b/test/test-cases/regression/issue-3340.json index 6251c860d4..bdc4e705ed 100644 --- a/test/test-cases/regression/issue-3340.json +++ b/test/test-cases/regression/issue-3340.json @@ -29,13 +29,13 @@ "uri": "/", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { "Content-Type": "text\/xml; charset=utf-8" }, - "body": "OK" + "body": "OK\n" }, "expected": { "http_code": 403 diff --git a/test/test-cases/regression/issue-394.json b/test/test-cases/regression/issue-394.json index 82827ac868..6d22ecf170 100644 --- a/test/test-cases/regression/issue-394.json +++ b/test/test-cases/regression/issue-394.json @@ -16,13 +16,13 @@ }, "request": { "headers": "", - "body": "", + "body": "\n", "method": "GET", "http_version": 1.1 }, "response": { "headers": "", - "body": "" + "body": "\n" }, "expected": { "audit_logs": "", diff --git a/test/test-cases/regression/issue-849.json b/test/test-cases/regression/issue-849.json index 60e0d4e2a4..e5bb9d8ee8 100644 --- a/test/test-cases/regression/issue-849.json +++ b/test/test-cases/regression/issue-849.json @@ -30,7 +30,7 @@ "uri": "\/test.pl?foo=bar", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { @@ -77,7 +77,7 @@ "uri": "\/test.pl?foo=bar", "method": "GET", "http_version": 1.1, - "body": "" + "body": "\n" }, "response": { "headers": { diff --git a/test/test-cases/regression/issue-960.json b/test/test-cases/regression/issue-960.json index 0fdb1ceaca..6abe8210ee 100644 --- a/test/test-cases/regression/issue-960.json +++ b/test/test-cases/regression/issue-960.json @@ -19,13 +19,13 @@ "Host": "www.google.com" }, "uri": "\/test.pl?param1= test ¶m2=test2", - "body": "", + "body": "\n", "method": "GET", "http_version": 1.1 }, "response": { "headers": "", - "body": "" + "body": "\n" }, "expected": { "audit_log": "", @@ -59,13 +59,13 @@ "Host": "www.google.com" }, "uri": "\/test.pl?param1= test ¶m2=test2", - "body": "", + "body": "\n", "method": "GET", "http_version": 1.1 }, "response": { "headers": "", - "body": "" + "body": "\n" }, "expected": { "audit_log": "", @@ -100,13 +100,13 @@ "Host": "www.google.com" }, "uri": "\/test.pl?param1= test ¶m2=test2", - "body": "", + "body": "\n", "method": "GET", "http_version": 1.1 }, "response": { "headers": "", - "body": "" + "body": "\n" }, "expected": { "audit_log": "", diff --git a/test/test-cases/regression/misc-variable-under-quotes.json b/test/test-cases/regression/misc-variable-under-quotes.json index 91be1eb736..ea31ec5787 100644 --- a/test/test-cases/regression/misc-variable-under-quotes.json +++ b/test/test-cases/regression/misc-variable-under-quotes.json @@ -27,7 +27,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -65,7 +65,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/offset-variable.json b/test/test-cases/regression/offset-variable.json index 599d7a7d50..2d88e040c8 100644 --- a/test/test-cases/regression/offset-variable.json +++ b/test/test-cases/regression/offset-variable.json @@ -18,7 +18,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -47,7 +47,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -70,7 +70,7 @@ "uri":"/index.html?param1=value1¶m2=value1", "method":"POST", "body":[ - "param1=value1¶m2=value1" + "param1=value1¶m2=value1\n" ] }, "response":{ @@ -79,7 +79,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -103,7 +103,7 @@ "uri":"/index.html?param1=value1¶m2=value1", "method":"POST", "body":[ - "param1=value1¶m2=value2¶m3=value3" + "param1=value1¶m2=value2¶m3=value3\n" ] }, "response":{ @@ -112,7 +112,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -136,7 +136,7 @@ "uri":"/index.html?param1=value1¶m2=value1", "method":"POST", "body":[ - "param1=value1¶m2=value2¶m3=value3" + "param1=value1¶m2=value2¶m3=value3\n" ] }, "response":{ @@ -145,7 +145,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -169,7 +169,7 @@ "uri":"/index.html?param1=value1¶m2=value1", "method":"POST", "body":[ - "param1=value1¶m2=value2¶m3=value3" + "param1=value1¶m2=value2¶m3=value3\n" ] }, "response":{ @@ -178,7 +178,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -202,7 +202,7 @@ "uri":"/index.html?param1=value1¶m2=value1", "method":"POST", "body":[ - "param1=value1¶m2=value2¶m3=value3" + "param1=value1¶m2=value2¶m3=value3\n" ] }, "response":{ @@ -211,7 +211,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -234,7 +234,7 @@ "uri":"/index.html?param1=value1¶m2=value1¶m3=value1", "method":"POST", "body":[ - "param1=value1¶m2=value2¶m3=value3" + "param1=value1¶m2=value2¶m3=value3\n" ] }, "response":{ @@ -243,7 +243,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -266,7 +266,7 @@ "uri":"/index.html?param1=value1¶m2=value1¶m3=value1", "method":"POST", "body":[ - "param1=value1¶m2=value2¶m3=value3" + "param1=value1¶m2=value2¶m3=value3\n" ] }, "response":{ @@ -275,7 +275,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -299,7 +299,7 @@ "uri":"/index.html?param1=value1¶m2=value1¶m3=value1", "method":"POST", "body":[ - "param1=value1¶m2=value2¶m3=value3" + "param1=value1¶m2=value2¶m3=value3\n" ] }, "response":{ @@ -308,7 +308,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -338,7 +338,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -368,7 +368,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -399,7 +399,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -431,7 +431,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -463,7 +463,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -495,7 +495,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -527,7 +527,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -559,7 +559,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -591,7 +591,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -623,7 +623,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -655,7 +655,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -687,7 +687,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -718,7 +718,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -749,7 +749,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -780,7 +780,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -812,7 +812,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -844,7 +844,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -876,7 +876,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -908,7 +908,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -950,7 +950,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -985,21 +985,21 @@ "uri":"/", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "expected":{ @@ -1034,21 +1034,21 @@ "uri":"/", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "expected":{ @@ -1083,21 +1083,21 @@ "uri":"/", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "expected":{ @@ -1132,21 +1132,21 @@ "uri":"/wheee/file?something else", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "expected":{ @@ -1181,21 +1181,21 @@ "uri":"/wheee/f%20i%20l%20e%20?something else", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "expected":{ @@ -1230,21 +1230,21 @@ "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "expected":{ @@ -1279,21 +1279,21 @@ "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file2.txt\"", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file2.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "expected":{ @@ -1328,25 +1328,25 @@ "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name2\"", - "", - "test2", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file2.txt\"", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name2\"\n", + "\n", + "test2\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file2.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "expected":{ @@ -1381,25 +1381,25 @@ "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name2\"", - "", - "test2", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" ", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name2\"\n", + "\n", + "test2\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" \n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "expected":{ @@ -1434,25 +1434,25 @@ "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name2\"", - "", - "test2", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" ", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name2\"\n", + "\n", + "test2\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" \n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "expected":{ @@ -1487,25 +1487,25 @@ "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name2\"", - "", - "test2", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" ", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name2\"\n", + "\n", + "test2\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" \n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "expected":{ @@ -1540,25 +1540,25 @@ "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name2\"", - "", - "test2", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" ", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name2\"\n", + "\n", + "test2\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" \n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "expected":{ @@ -1593,25 +1593,25 @@ "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name2\"", - "", - "test2", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" ", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name2\"\n", + "\n", + "test2\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" \n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "expected":{ @@ -1646,25 +1646,25 @@ "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name2\"", - "", - "test2", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" ", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name2\"\n", + "\n", + "test2\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" \n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "expected":{ @@ -1699,25 +1699,25 @@ "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name2\"", - "", - "test2", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" ", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name2\"\n", + "\n", + "test2\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" \n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "expected":{ @@ -1754,25 +1754,25 @@ "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name2\"", - "", - "test2", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" ", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name2\"\n", + "\n", + "test2\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" \n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "expected":{ @@ -1809,25 +1809,25 @@ "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name2\"", - "", - "test2", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" ", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name2\"\n", + "\n", + "test2\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" \n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "expected":{ @@ -1864,25 +1864,25 @@ "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name2\"", - "", - "test2", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" ", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name2\"\n", + "\n", + "test2\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" \n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "expected":{ @@ -1919,25 +1919,25 @@ "uri":"/wheee/f%20i%20l%20e%20", "method":"POST", "body":[ - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name\"", - "", - "test", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"name2\"", - "", - "test2", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"", - "Content-Type: text/plain", - "", - "This is a very small test file..", - "----------------------------756b6d74fa1a8ee2", - "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" ", - "Content-Type: text/plain", - "", - "This is another very small test file..", - "----------------------------756b6d74fa1a8ee2--" + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name\"\n", + "\n", + "test\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"name2\"\n", + "\n", + "test2\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"\n", + "Content-Type: text/plain\n", + "\n", + "This is a very small test file..\n", + "----------------------------756b6d74fa1a8ee2\n", + "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"fiasdfasdfledata\" \n", + "Content-Type: text/plain\n", + "\n", + "This is another very small test file..\n", + "----------------------------756b6d74fa1a8ee2--\n" ] }, "expected":{ @@ -1969,7 +1969,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ @@ -2000,7 +2000,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/operator-UnconditionalMatch.json b/test/test-cases/regression/operator-UnconditionalMatch.json index 5f73a2ec2e..f291bbe5a3 100644 --- a/test/test-cases/regression/operator-UnconditionalMatch.json +++ b/test/test-cases/regression/operator-UnconditionalMatch.json @@ -22,7 +22,7 @@ "uri":"/", "method":"POST", "body": [ - "param1=value1¶m2=value2" + "param1=value1¶m2=value2\n" ] }, "response":{ @@ -32,7 +32,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/operator-detectsqli.json b/test/test-cases/regression/operator-detectsqli.json index e2e33c908f..1186f01eab 100644 --- a/test/test-cases/regression/operator-detectsqli.json +++ b/test/test-cases/regression/operator-detectsqli.json @@ -22,7 +22,7 @@ "uri":"/", "method":"POST", "body": [ - "param1=ascii(substring(version() from 1 for 1))¶m2=value2" + "param1=ascii(substring(version() from 1 for 1))¶m2=value2\n" ] }, "response":{ @@ -32,7 +32,7 @@ "Content-Type":"text/html" }, "body":[ - "no need." + "no need.\n" ] }, "expected":{ diff --git a/test/test-cases/regression/operator-detectxss.json b/test/test-cases/regression/operator-detectxss.json index e2590193b0..075be024ec 100644 --- a/test/test-cases/regression/operator-detectxss.json +++ b/test/test-cases/regression/operator-detectxss.json @@ -22,7 +22,7 @@ "uri":"/", "method":"POST", "body": [ - "param1=