AK: URL should urldecode data: URL payloads

Otherwise we can end up with percent-encoded nonsense in base64 data
which does not decode correctly.
This commit is contained in:
Andreas Kling 2020-06-10 17:45:34 +02:00
parent 2622ead6c6
commit ff6de8a169
Notes: sideshowbarker 2024-07-19 05:43:31 +09:00

View file

@ -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())