1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:37:34 +00:00

WebServer: Add basic directory listings

If a directory does not have an index.html file, we will now generate
a directory listing HTML document for that directory on the fly. :^)
This commit is contained in:
Andreas Kling 2020-02-12 21:18:04 +01:00
parent 90fec9c732
commit 083f3edcb0
2 changed files with 58 additions and 7 deletions

View file

@ -44,9 +44,11 @@ private:
Client(NonnullRefPtr<Core::TCPSocket>, Core::Object* parent);
void handle_request(ByteBuffer);
void send_response(StringView, const Core::HttpRequest&);
void send_error_response(unsigned code, const StringView& message, const Core::HttpRequest&);
void die();
void log_response(unsigned code, const Core::HttpRequest&);
void handle_directory_listing(const String& requested_path, const String& real_path, const Core::HttpRequest&);
NonnullRefPtr<Core::TCPSocket> m_socket;
};