From 82c081385bc22d4b5c63c832ee5d8bdc00f0a9ae Mon Sep 17 00:00:00 2001 From: Albert S Date: Wed, 30 Mar 2022 22:59:18 +0200 Subject: [PATCH] Request: createPairFromVar(): Explicitly decode value May not be the case on POST requests. --- request.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/request.cpp b/request.cpp index 0566343..5ea0527 100644 --- a/request.cpp +++ b/request.cpp @@ -40,7 +40,7 @@ std::pair Request::createPairFromVar(std::string var) else { std::string key = var.substr(0, equal); - std::string val = utils::html_xss(var.substr(equal + 1)); + std::string val = utils::html_xss(utils::urldecode(var.substr(equal + 1))); return std::make_pair(std::move(key), std::move(val)); } } @@ -75,7 +75,7 @@ void Request::initPostMap(const std::string &url) void Request::initCookies(const std::string &cookiestr) { // TODO: find out what it really should be, ";" or "; "? - std::regex regex { ";+\\s?" }; + std::regex regex{";+\\s?"}; auto cookiesplitted = utils::split(cookiestr, regex); for(const std::string &part : cookiesplitted) {