feat: add custom 400 error page and update configuration for error handling

This commit is contained in:
Quinten 2025-09-30 18:02:13 +02:00
parent 1c634ddc02
commit 9320d83378
4 changed files with 3 additions and 4 deletions

View File

@ -1,5 +1,6 @@
autoindex on
error_page 400 ./400.html
error_page 400 ./error_pages/400.html
error_page 500 ./error_pages/500.html

View File

@ -61,7 +61,7 @@ std::string ErrorHandler::getErrorPageFile(const std::string &path)
if (!file.is_open())
{
Log::error("Could not open custom error page: " + path);
return generateErrorPage(Http::StatusCode::INTERNAL_SERVER_ERROR);
return generateDefaultErrorPage(Http::StatusCode::INTERNAL_SERVER_ERROR);
}
std::stringstream buffer;
buffer << file.rdbuf();

View File

@ -83,8 +83,6 @@ void Server::removeClient(const Client &client)
Log::trace(LOCATION);
int client_fd = client.getSocket().getFd();
clients_.erase(client_fd);
// removeFromEpoll(client.getSocket());
// close(client_fd);
}
void Server::removeFromEpoll(const Socket &socket) const