diff --git a/CHANGES b/CHANGES index 207d9a4c..e4a4916c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ v3.0.4 - YYYY-MMM-DD (to be released) ------------------------------------- + - Additional adjustment to Cookie header parsing + [@martinhsv] - Restore chained rule part H logging to be more like 2.9 behaviour [Issue #2196 - @martinhsv] - Small fixes in log messages to help debugging the file upload diff --git a/src/transaction.cc b/src/transaction.cc index 16361b70..dc2ca655 100644 --- a/src/transaction.cc +++ b/src/transaction.cc @@ -552,9 +552,9 @@ int Transaction::addRequestHeader(const std::string& key, std::vector cookies = utils::string::ssplit(value, ';'); - // Get rid of any optional whitespace after the cookie-string - // (i.e. after the end of the final cookie-pair) if (!cookies.empty()) { + // Get rid of any optional whitespace after the cookie-string + // (i.e. after the end of the final cookie-pair) std::string& final_cookie_pair = cookies.back(); while (!final_cookie_pair.empty() && isspace(final_cookie_pair.back())) { final_cookie_pair.pop_back(); @@ -586,7 +586,7 @@ int Transaction::addRequestHeader(const std::string& key, } // ltrim the key - following the modsec v2 way - while (ckey.empty() == false && ckey.at(0) == ' ') { + while (ckey.empty() == false && isspace(ckey.at(0))) { ckey.erase(0, 1); localOffset++; }