Skip to content

Commit

Permalink
Set the status code in WebRoot::_handle_error_send_request().
Browse files Browse the repository at this point in the history
  • Loading branch information
Relintai committed May 22, 2024
1 parent 7476c86 commit db1a380
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/web/http/web_root.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>";

Expand Down

0 comments on commit db1a380

Please sign in to comment.