From ff6de8a1697714dfa020c5a0fbe0a0c1e6f30fe7 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 10 Jun 2020 17:45:34 +0200 Subject: [PATCH] AK: URL should urldecode data: URL payloads Otherwise we can end up with percent-encoded nonsense in base64 data which does not decode correctly. --- AK/URL.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AK/URL.cpp b/AK/URL.cpp index 91e8094ab51..4278ea9ceb6 100644 --- a/AK/URL.cpp +++ b/AK/URL.cpp @@ -27,6 +27,7 @@ #include #include #include +#include namespace AK { @@ -238,7 +239,7 @@ bool URL::parse(const StringView& string) if (state == State::InFragment) m_fragment = String::copy(buffer); if (state == State::InDataPayload) - m_data_payload = String::copy(buffer); + m_data_payload = urldecode(String::copy(buffer)); if (m_query.is_null()) m_query = ""; if (m_fragment.is_null())