diff options
author | Ed Tanous <edtanous@google.com> | 2023-03-28 00:43:19 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2023-06-08 19:40:08 +0300 |
commit | c51a58ee9231e48bb25ede75307591758f911395 (patch) | |
tree | d0c17dfd7aff3cc453fee667ff999fa0f61908ee /include/http_utility.hpp | |
parent | f9c794fbf2053c664902efa5d9ef638ef08acb38 (diff) | |
download | bmcweb-c51a58ee9231e48bb25ede75307591758f911395.tar.xz |
Remove urlEncode
All new uses should be using boost::urls::url now. This was the last
usage.
Tested: Logged into webui, and observed the correct URL behavior.
In browser window /foobar
Forwarded to /?next=/foobar#/login
Which is correct.
Note, this is different behavior slightly than before. It was found
that the URI precedence goes query string THEN fragment, rather than the
other way around that we had it. This was flagged when moving over to
boost url structures.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ifb354537d71a43c531d7d380dd889cf646731e39
Diffstat (limited to 'include/http_utility.hpp')
-rw-r--r-- | include/http_utility.hpp | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/include/http_utility.hpp b/include/http_utility.hpp index d18ac4bdf5..eb54d0b194 100644 --- a/include/http_utility.hpp +++ b/include/http_utility.hpp @@ -111,28 +111,4 @@ inline bool isContentTypeAllowed(std::string_view header, ContentType type, return type == allowed; } -inline std::string urlEncode(std::string_view value) -{ - std::ostringstream escaped; - escaped.fill('0'); - escaped << std::hex; - - for (const char c : value) - { - // Keep alphanumeric and other accepted characters intact - if ((isalnum(c) != 0) || c == '-' || c == '_' || c == '.' || c == '~') - { - escaped << c; - continue; - } - - // Any other characters are percent-encoded - escaped << std::uppercase; - escaped << '%' << std::setw(2) - << static_cast<int>(static_cast<unsigned char>(c)); - escaped << std::nouppercase; - } - - return escaped.str(); -} } // namespace http_helpers |