1
Fork 0
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:
Andreas Kling 2019-12-10 21:13:00 +01:00
parent 40b7d814c3
commit 9641f74310

View file

@ -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] == '/';