LibHTTP: Don't re-urlencode URL query strings

AK::URL stores the URL query string already encoded. We were sending
double-encoded query strings, which is why the Google cookie consent
page was not working correctly.
This commit is contained in:
Andreas Kling 2022-04-10 01:35:57 +02:00
parent 79c77debb0
commit db2b67dc5e
Notes: sideshowbarker 2024-07-17 22:55:25 +09:00

View file

@ -37,7 +37,7 @@ ByteBuffer HttpRequest::to_raw_request() const
builder.append(URL::percent_encode(m_url.path(), URL::PercentEncodeSet::EncodeURI));
if (!m_url.query().is_empty()) {
builder.append('?');
builder.append(URL::percent_encode(m_url.query(), URL::PercentEncodeSet::EncodeURI));
builder.append(m_url.query());
}
builder.append(" HTTP/1.1\r\nHost: ");
builder.append(m_url.host());