AK: Handle "protocol relative URLs" in URL::complete_url()

This commit is contained in:
Linus Groh 2020-05-16 18:54:09 +01:00 committed by Andreas Kling
parent 91f70a9258
commit b193670967

View file

@ -293,6 +293,12 @@ URL URL::complete_url(const String& string) const
if (url.is_valid())
return url;
if (string.starts_with("//")) {
URL url(String::format("%s:%s", m_protocol.characters(), string.characters()));
if (url.is_valid())
return url;
}
if (string.starts_with("/")) {
url = *this;
url.set_path(string);