mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
WebServer: Use relative URLs for the directory listing
This fixes an issue found on Linus's hosted WebServer. Now, if WebServer is hosted at a non-root URL. (eg, `example.com/webserver` instead of `example.com`) the links will correctly go to `example.com/webserver/foo` instead of `example.com/foo`.
This commit is contained in:
parent
cce5e3158f
commit
7dfe1f9f8f
Notes:
sideshowbarker
2024-07-16 23:08:48 +09:00
Author: https://github.com/AtkinsSJ
Commit: 7dfe1f9f8f
Pull-request: https://github.com/SerenityOS/serenity/pull/18062
Reviewed-by: https://github.com/linusg ✅
1 changed files with 1 additions and 1 deletions
|
@ -313,7 +313,7 @@ ErrorOr<void> Client::handle_directory_listing(String const& requested_path, Str
|
|||
|
||||
builder.append("<tr>"sv);
|
||||
builder.appendff("<td><div class=\"{}\"></div></td>", is_directory ? "folder" : "file");
|
||||
builder.append("<td><a href=\""sv);
|
||||
builder.append("<td><a href=\"./"sv);
|
||||
builder.append(URL::percent_encode(name));
|
||||
// NOTE: For directories, we append a slash so we don't always hit the redirect case,
|
||||
// which adds a slash anyways.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue