mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Use text encoding from DOM when parsing URLs
This passes the DOM encoding down to the URL parser, so the correct encoder can be used.
This commit is contained in:
parent
d80575a410
commit
c1958437f9
Notes:
github-actions[bot]
2024-08-08 16:51:10 +00:00
Author: https://github.com/BenJilks
Commit: c1958437f9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/975
Reviewed-by: https://github.com/shannonbooth
Reviewed-by: https://github.com/skyrising
Reviewed-by: https://github.com/tcl3 ✅
5 changed files with 11 additions and 8 deletions
|
@ -585,12 +585,12 @@ void strip_trailing_spaces_from_an_opaque_path(DOMURL& url)
|
|||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#concept-url-parser
|
||||
URL::URL parse(StringView input, Optional<URL::URL> const& base_url)
|
||||
URL::URL parse(StringView input, Optional<URL::URL> const& base_url, Optional<StringView> encoding)
|
||||
{
|
||||
// FIXME: We should probably have an extended version of URL::URL for LibWeb instead of standalone functions like this.
|
||||
|
||||
// 1. Let url be the result of running the basic URL parser on input with base and encoding.
|
||||
auto url = URL::Parser::basic_parse(input, base_url);
|
||||
auto url = URL::Parser::basic_parse(input, base_url, {}, {}, encoding);
|
||||
|
||||
// 2. If url is failure, return failure.
|
||||
if (!url.is_valid())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue