mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
AK: Handle "protocol relative URLs" in URL::complete_url()
This commit is contained in:
parent
91f70a9258
commit
b193670967
1 changed files with 6 additions and 0 deletions
|
@ -293,6 +293,12 @@ URL URL::complete_url(const String& string) const
|
||||||
if (url.is_valid())
|
if (url.is_valid())
|
||||||
return url;
|
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("/")) {
|
if (string.starts_with("/")) {
|
||||||
url = *this;
|
url = *this;
|
||||||
url.set_path(string);
|
url.set_path(string);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue