mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 00:17:46 +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())
|
||||
return url;
|
||||
|
||||
FileSystemPath fspath(path());
|
||||
if (string.starts_with("/")) {
|
||||
url = *this;
|
||||
url.set_path(string);
|
||||
return url;
|
||||
}
|
||||
|
||||
StringBuilder builder;
|
||||
FileSystemPath fspath(path());
|
||||
builder.append('/');
|
||||
|
||||
bool document_url_ends_in_slash = path()[path().length() - 1] == '/';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue