mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +00:00
LibHTML: Fix relative URL completion when document URL ends in a slash
This commit is contained in:
parent
796e63b34c
commit
ebacef36ee
Notes:
sideshowbarker
2024-07-19 11:44:25 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/ebacef36ee8
1 changed files with 4 additions and 1 deletions
|
@ -113,8 +113,11 @@ URL Document::complete_url(const String& string) const
|
|||
FileSystemPath fspath(m_url.path());
|
||||
StringBuilder builder;
|
||||
builder.append('/');
|
||||
|
||||
bool document_url_ends_in_slash = m_url.path()[m_url.path().length() - 1] == '/';
|
||||
|
||||
for (int i = 0; i < fspath.parts().size(); ++i) {
|
||||
if (i == fspath.parts().size() - 1)
|
||||
if (i == fspath.parts().size() - 1 && !document_url_ends_in_slash)
|
||||
break;
|
||||
builder.append(fspath.parts()[i]);
|
||||
builder.append('/');
|
||||
|
|
Loading…
Add table
Reference in a new issue