mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-27 11:48:59 +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:
parent
58398b1e12
commit
737f5b26b7
Notes:
sideshowbarker
2024-07-17 16:19:00 +09:00
Author: https://github.com/GeekFiftyFive
Commit: 737f5b26b7
Pull-request: https://github.com/SerenityOS/serenity/pull/13376
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
3 changed files with 7 additions and 7 deletions
4
AK/URL.h
4
AK/URL.h
|
@ -104,7 +104,7 @@ public:
|
|||
static u16 default_port_for_scheme(StringView);
|
||||
static bool is_special_scheme(StringView);
|
||||
|
||||
static String percent_encode(StringView input, PercentEncodeSet set = PercentEncodeSet::Userinfo);
|
||||
static String percent_encode(StringView input, PercentEncodeSet set = PercentEncodeSet::Userinfo, StringView reserved_chars = {});
|
||||
static String percent_decode(StringView input);
|
||||
|
||||
bool operator==(URL const& other) const { return equals(other, ExcludeFragment::No); }
|
||||
|
@ -122,7 +122,7 @@ private:
|
|||
bool compute_validity() const;
|
||||
String serialize_data_url() const;
|
||||
|
||||
static void append_percent_encoded_if_necessary(StringBuilder&, u32 code_point, PercentEncodeSet set = PercentEncodeSet::Userinfo);
|
||||
static void append_percent_encoded_if_necessary(StringBuilder&, u32 code_point, PercentEncodeSet set = PercentEncodeSet::Userinfo, StringView reserved_chars = {});
|
||||
static void append_percent_encoded(StringBuilder&, u32 code_point);
|
||||
|
||||
bool m_valid { false };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue