mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
AK: Fix URL::complete_url behaviour for when a fragment is passed
Previously, passing a fragment string ("#section3") to the complete_url method would result in a URL that looked like "file:///home/anon/www/#section3" which was obviously incorrect. Now the result looks like "file:///home/anon/www/afrag.html#section3".
This commit is contained in:
parent
2e4147d0fc
commit
b1e4f70173
1 changed files with 6 additions and 0 deletions
|
@ -307,6 +307,12 @@ URL URL::complete_url(const String& string) const
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (string.starts_with("#")) {
|
||||||
|
url = *this;
|
||||||
|
url.set_fragment(string.substring(1, string.length() - 1));
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
StringBuilder builder;
|
StringBuilder builder;
|
||||||
FileSystemPath fspath(path());
|
FileSystemPath fspath(path());
|
||||||
builder.append('/');
|
builder.append('/');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue