diff options
author | Andreas Kling <kling@serenityos.org> | 2020-06-10 17:45:34 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-06-10 17:45:34 +0200 |
commit | ff6de8a1697714dfa020c5a0fbe0a0c1e6f30fe7 (patch) | |
tree | 552c8d4c0d4951a58d2a16b959bb93e3527e79e3 | |
parent | 2622ead6c648d0af210cfc750c95ed58fb65b072 (diff) | |
download | serenity-ff6de8a1697714dfa020c5a0fbe0a0c1e6f30fe7.zip |
AK: URL should urldecode data: URL payloads
Otherwise we can end up with percent-encoded nonsense in base64 data
which does not decode correctly.
-rw-r--r-- | AK/URL.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/AK/URL.cpp b/AK/URL.cpp index 91e8094ab5..4278ea9ceb 100644 --- a/AK/URL.cpp +++ b/AK/URL.cpp @@ -27,6 +27,7 @@ #include <AK/LexicalPath.h> #include <AK/StringBuilder.h> #include <AK/URL.h> +#include <AK/URLParser.h> 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()) |