mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +00:00
LibURL+LibWeb: Port URL::complete_url to Optional
Removing one more source of the URL::is_valid API.
This commit is contained in:
parent
356728b1e0
commit
53826995f6
Notes:
github-actions[bot]
2025-02-15 17:07:12 +00:00
Author: https://github.com/shannonbooth
Commit: 53826995f6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3586
Reviewed-by: https://github.com/tcl3 ✅
14 changed files with 57 additions and 52 deletions
|
@ -33,16 +33,12 @@ URL::URL(StringView string)
|
|||
}
|
||||
}
|
||||
|
||||
URL URL::complete_url(StringView relative_url) const
|
||||
Optional<URL> URL::complete_url(StringView relative_url) const
|
||||
{
|
||||
if (!is_valid())
|
||||
return {};
|
||||
|
||||
auto result = Parser::basic_parse(relative_url, *this);
|
||||
if (!result.has_value())
|
||||
return {};
|
||||
|
||||
return result.release_value();
|
||||
return Parser::basic_parse(relative_url, *this);
|
||||
}
|
||||
|
||||
ByteString URL::path_segment_at_index(size_t index) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue