Set the status code in WebRoot::_handle_error_send_request().

This commit is contained in:
Relintai 2024-05-22 07:25:16 +02:00
parent 7476c8608c
commit db1a38081b

View File

@ -131,6 +131,8 @@ void WebRoot::_handle_request_main(Ref<WebServerRequest> request) {
}
void WebRoot::_handle_error_send_request(Ref<WebServerRequest> request, const int error_code) {
request->set_status_code(static_cast<HTTPServerEnums::HTTPStatusCode>(error_code));
if (error_code == HTTPServerEnums::HTTP_STATUS_CODE_404_NOT_FOUND) {
request->compiled_body = "<html><body>404 :(</body></html>";