mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
AK: Teach URL::complete_url() how to resolve URL's starting with "/"
This commit is contained in:
parent
40b7d814c3
commit
9641f74310
Notes:
sideshowbarker
2024-07-19 10:53:45 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/9641f743101
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
Reference in a new issue