mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
LibHTTP: Don't double percent encode path in HTTPRequst::to_raw_request
This was a goof in cc55732332
which
resulted in the URL path getting double percent encoded. Since the path
already comes out percent encoded following the rules in the URL spec -
we don't need to percent encode again.
Fixes: #978
This commit is contained in:
parent
8723f72f0f
commit
2995a57f63
Notes:
github-actions[bot]
2024-08-06 07:19:13 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/2995a57f631 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/983 Reviewed-by: https://github.com/tcl3 ✅
1 changed files with 1 additions and 2 deletions
|
@ -49,10 +49,9 @@ ErrorOr<ByteBuffer> HttpRequest::to_raw_request() const
|
|||
StringBuilder builder;
|
||||
TRY(builder.try_append(method_name()));
|
||||
TRY(builder.try_append(' '));
|
||||
// NOTE: The percent_encode is so that e.g. spaces are properly encoded.
|
||||
auto path = m_url.serialize_path();
|
||||
VERIFY(!path.is_empty());
|
||||
TRY(builder.try_append(URL::percent_encode(path, URL::PercentEncodeSet::EncodeURI)));
|
||||
TRY(builder.try_append(path));
|
||||
if (m_url.query().has_value()) {
|
||||
TRY(builder.try_append('?'));
|
||||
TRY(builder.try_append(*m_url.query()));
|
||||
|
|
Loading…
Reference in a new issue