diff --git a/Userland/Services/WebServer/Client.cpp b/Userland/Services/WebServer/Client.cpp index 3d7d0f5be6..186f18d411 100644 --- a/Userland/Services/WebServer/Client.cpp +++ b/Userland/Services/WebServer/Client.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -211,9 +212,12 @@ void Client::handle_directory_listing(String const& requested_path, String const builder.append("\n"); Core::DirIterator dt(real_path); - while (dt.has_next()) { - auto name = dt.next_path(); + Vector names; + while (dt.has_next()) + names.append(dt.next_path()); + quick_sort(names); + for (auto& name : names) { StringBuilder path_builder; path_builder.append(real_path); path_builder.append('/');