mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibWeb: Port Document encoding_parse_url and parse_url to Optional<URL>
This ports two more APIs away from URL::is_valid.
This commit is contained in:
parent
cfe9b7a82b
commit
22a7cd9700
Notes:
github-actions[bot]
2025-01-27 00:04:07 +00:00
Author: https://github.com/shannonbooth
Commit: 22a7cd9700
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3362
Reviewed-by: https://github.com/tcl3 ✅
26 changed files with 135 additions and 107 deletions
|
@ -433,14 +433,14 @@ void ConnectionFromClient::debug_request(u64 page_id, ByteString const& request,
|
|||
} else {
|
||||
auto link = maybe_link.release_value();
|
||||
auto url = document->encoding_parse_url(link->get_attribute_value(Web::HTML::AttributeNames::href));
|
||||
if (url.query().has_value() && !url.query()->is_empty()) {
|
||||
if (url->query().has_value() && !url->query()->is_empty()) {
|
||||
load_html(page_id, "<h1>Invalid ref test link - query string must be empty</h1>");
|
||||
return;
|
||||
}
|
||||
if (has_mismatch_selector)
|
||||
url.set_query("mismatch"_string);
|
||||
url->set_query("mismatch"_string);
|
||||
|
||||
load_url(page_id, url);
|
||||
load_url(page_id, *url);
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue