feat: add custom 400 error page and update configuration for error handling
This commit is contained in:
parent
1c634ddc02
commit
9320d83378
@ -1,5 +1,6 @@
|
|||||||
autoindex on
|
autoindex on
|
||||||
error_page 400 ./400.html
|
error_page 400 ./error_pages/400.html
|
||||||
|
error_page 500 ./error_pages/500.html
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -61,7 +61,7 @@ std::string ErrorHandler::getErrorPageFile(const std::string &path)
|
|||||||
if (!file.is_open())
|
if (!file.is_open())
|
||||||
{
|
{
|
||||||
Log::error("Could not open custom error page: " + path);
|
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;
|
std::stringstream buffer;
|
||||||
buffer << file.rdbuf();
|
buffer << file.rdbuf();
|
||||||
|
|||||||
@ -83,8 +83,6 @@ void Server::removeClient(const Client &client)
|
|||||||
Log::trace(LOCATION);
|
Log::trace(LOCATION);
|
||||||
int client_fd = client.getSocket().getFd();
|
int client_fd = client.getSocket().getFd();
|
||||||
clients_.erase(client_fd);
|
clients_.erase(client_fd);
|
||||||
// removeFromEpoll(client.getSocket());
|
|
||||||
// close(client_fd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Server::removeFromEpoll(const Socket &socket) const
|
void Server::removeFromEpoll(const Socket &socket) const
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user