diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-11-15 23:43:55 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2026-02-03 21:37:04 +0100 |
| commit | f63f9b9d2452c3eac2bb6c6b7c8663570768425a (patch) | |
| tree | 333641a6e0748ae5ce98b82a881d9b45ad1d8dfa /src/lib/http_server.cc | |
| parent | fd5185eb231228fd1815832093d57558bc90dee3 (diff) | |
Return 500 when some server error occurs.
Diffstat (limited to 'src/lib/http_server.cc')
| -rw-r--r-- | src/lib/http_server.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/http_server.cc b/src/lib/http_server.cc index 294d350ac..cf3f9756a 100644 --- a/src/lib/http_server.cc +++ b/src/lib/http_server.cc @@ -38,6 +38,7 @@ using std::vector; Response Response::ERROR_404 = { 404, "<html><head><title>Error 404</title></head><body><h1>Error 404</h1></body></html>"}; +Response Response::ERROR_500 = { 500, "<html><head><title>Error 500</title></head><body><h1>Error 500</h1></body></html>"}; HTTPServer::HTTPServer(int port, int timeout) @@ -156,8 +157,8 @@ HTTPServer::request(vector<string> const& request) LOG_ERROR("Unknown exception while handling HTTP request"); } - LOG_HTTP("404 {}", parts[0]); - return Response::ERROR_404; + LOG_HTTP("500 {}", parts[0]); + return Response::ERROR_500; } |
