mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:27:44 +00:00
AK: Make sure URL retains trailing slash if present in complete_url
This commit is contained in:
parent
013cb76d77
commit
b5b08fba92
2 changed files with 17 additions and 1 deletions
10
AK/URL.cpp
10
AK/URL.cpp
|
@ -323,8 +323,16 @@ URL URL::complete_url(const String& string) const
|
|||
auto built = builder.to_string();
|
||||
fspath = FileSystemPath(built);
|
||||
|
||||
built = fspath.string();
|
||||
if (string.ends_with('/') && !built.ends_with('/')) {
|
||||
builder.clear();
|
||||
builder.append(built);
|
||||
builder.append('/');
|
||||
built = builder.to_string();
|
||||
}
|
||||
|
||||
url = *this;
|
||||
url.set_path(fspath.string());
|
||||
url.set_path(built);
|
||||
return url;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue