1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:07:47 +00:00

AK: Use base URL when the specified URL is empty

This commit is contained in:
Thiago Henrique Hupner 2022-12-27 16:17:30 -03:00 committed by Andrew Kaster
parent 96d3d3b0fe
commit 401bc13776
2 changed files with 10 additions and 1 deletions

View file

@ -201,7 +201,7 @@ URL URLParser::parse(StringView raw_input, URL const* base_url, Optional<URL> ur
{
dbgln_if(URL_PARSER_DEBUG, "URLParser::parse: Parsing '{}'", raw_input);
if (raw_input.is_empty())
return {};
return base_url ? *base_url : URL {};
if (raw_input.starts_with("data:"sv)) {
auto maybe_url = parse_data_url(raw_input);