From 2c5a8462ece5ddcc744e209298fad75d35bbe511 Mon Sep 17 00:00:00 2001 From: Max Wipfli Date: Mon, 7 Jun 2021 13:28:51 +0200 Subject: [PATCH] WebServer: Append trailing slash for directory links This adds trailing slashes to all links to directories (when listing the directory contents). This avoids the redirect that would otherwise happen when browsing to those directories. --- Userland/Services/WebServer/Client.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Services/WebServer/Client.cpp b/Userland/Services/WebServer/Client.cpp index 2237a994c20..3d7d0f5be65 100644 --- a/Userland/Services/WebServer/Client.cpp +++ b/Userland/Services/WebServer/Client.cpp @@ -237,6 +237,10 @@ void Client::handle_directory_listing(String const& requested_path, String const builder.appendff("
", is_directory ? "folder" : "file"); builder.append(""); builder.append(escape_html_entities(name)); builder.append(" ");