mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 12:17:35 +00:00
AK: Teach URL::complete_url() how to resolve URL's starting with "/"
This commit is contained in:
parent
40b7d814c3
commit
9641f74310
1 changed files with 7 additions and 1 deletions
|
@ -157,8 +157,14 @@ URL URL::complete_url(const String& string) const
|
||||||
if (url.is_valid())
|
if (url.is_valid())
|
||||||
return url;
|
return url;
|
||||||
|
|
||||||
FileSystemPath fspath(path());
|
if (string.starts_with("/")) {
|
||||||
|
url = *this;
|
||||||
|
url.set_path(string);
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
StringBuilder builder;
|
StringBuilder builder;
|
||||||
|
FileSystemPath fspath(path());
|
||||||
builder.append('/');
|
builder.append('/');
|
||||||
|
|
||||||
bool document_url_ends_in_slash = path()[path().length() - 1] == '/';
|
bool document_url_ends_in_slash = path()[path().length() - 1] == '/';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue