AK: Expose URLParser::percent_encode_after_encoding

This function is useful in places outside of the URLParser in LibWeb.
This commit is contained in:
Shannon Booth 2023-06-25 14:11:34 +12:00 committed by Andreas Kling
parent c445bd3a0c
commit be9fcaf92d
Notes: sideshowbarker 2024-07-17 05:13:53 +09:00
2 changed files with 4 additions and 1 deletions

View file

@ -117,7 +117,7 @@ constexpr bool is_double_dot_path_segment(StringView input)
}
// https://url.spec.whatwg.org/#string-percent-encode-after-encoding
static DeprecatedString percent_encode_after_encoding(StringView input, URL::PercentEncodeSet percent_encode_set, bool space_as_plus = false)
DeprecatedString URLParser::percent_encode_after_encoding(StringView input, URL::PercentEncodeSet percent_encode_set, bool space_as_plus)
{
// NOTE: This is written somewhat ad-hoc since we don't yet implement the Encoding spec.

View file

@ -57,6 +57,9 @@ public:
static URL parse(StringView input, Optional<URL> const& base_url = {}, Optional<URL> url = {}, Optional<State> state_override = {});
// https://url.spec.whatwg.org/#string-percent-encode-after-encoding
static DeprecatedString percent_encode_after_encoding(StringView input, URL::PercentEncodeSet percent_encode_set, bool space_as_plus = false);
private:
static Optional<URL> parse_data_url(StringView raw_input);
};