From db1a38081bbb5d01049b272b4417c1f19ff787f9 Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 22 May 2024 07:25:16 +0200 Subject: [PATCH] Set the status code in WebRoot::_handle_error_send_request(). --- modules/web/http/web_root.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/web/http/web_root.cpp b/modules/web/http/web_root.cpp index 06fbb8e97..96edabb97 100644 --- a/modules/web/http/web_root.cpp +++ b/modules/web/http/web_root.cpp @@ -131,6 +131,8 @@ void WebRoot::_handle_request_main(Ref request) { } void WebRoot::_handle_error_send_request(Ref request, const int error_code) { + request->set_status_code(static_cast(error_code)); + if (error_code == HTTPServerEnums::HTTP_STATUS_CODE_404_NOT_FOUND) { request->compiled_body = "404 :(";