mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-06 13:35:03 +00:00
AK+LibHTTP: Ensure plus signs are percent encoded in query string
Adds a new optional parameter 'reserved_chars' to AK::URL::percent_encode. This new optional parameter allows the caller to specify custom characters to be percent encoded. This is then used to percent encode plus signs by HttpRequest::to_raw_request.
This commit is contained in:
committed by
Andreas Kling
parent
58398b1e12
commit
737f5b26b7
@@ -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(URL::percent_encode(m_url.query(), URL::PercentEncodeSet::EncodeURI, "+"sv));
|
||||
}
|
||||
builder.append(" HTTP/1.1\r\nHost: ");
|
||||
builder.append(m_url.host());
|
||||
|
||||
Reference in New Issue
Block a user