1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:28:12 +00:00

LibWebView: Avoid trying to break a schemeless URL into renderable parts

This commit is contained in:
Timothy Flynn 2023-12-04 08:54:40 -05:00 committed by Sam Atkins
parent 65a9eae142
commit 965bd00cf3
2 changed files with 9 additions and 1 deletions

View file

@ -144,7 +144,11 @@ Optional<URLParts> break_url_into_parts(StringView url_string)
if (!url.is_valid())
return {};
auto scheme_length = url.scheme().bytes_as_string_view().length();
auto const& scheme = url.scheme();
auto scheme_length = scheme.bytes_as_string_view().length();
if (!url_string.starts_with(scheme))
return {};
if (!url_string.substring_view(scheme_length).starts_with("://"sv))
return {};