mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibURL/Pattern: Use opaque pathname serialization in canonicalization
The URL spec represents its path as a: Variant<String, Vector<String>> A URL is defined has having an opaque path if it has a single String, the URL path otherwise containing a list of path components. We (like in an older version of the spec) track this through a boolean and only use a Vector with a single component for opaque paths. This means it was incorrect to simple assign the path to a list with a single empty string without setting that URL as opaque, which meant that the path serialization was producing incorrect results. It may make sense changing the API so this situation is a little more clear. But for now, we simply need to set the opaque path boolean to true here.
This commit is contained in:
parent
e7ad9a9bad
commit
dcb7842f59
Notes:
github-actions[bot]
2025-04-06 12:26:44 +00:00
Author: https://github.com/shannonbooth
Commit: dcb7842f59
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3847
Reviewed-by: https://github.com/trflynn89
2 changed files with 5 additions and 4 deletions
|
@ -202,6 +202,7 @@ PatternErrorOr<String> canonicalize_an_opaque_pathname(String const& value)
|
|||
|
||||
// 3. Set dummyURL’s path to the empty string.
|
||||
dummy_url.set_paths({ "" });
|
||||
dummy_url.set_has_an_opaque_path(true);
|
||||
|
||||
// 4. Let parseResult be the result of running URL parsing given value with dummyURL as url and opaque path state as state override.
|
||||
auto parse_result = Parser::basic_parse(value, {}, &dummy_url, Parser::State::OpaquePath);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue