From 89dc9afc2887119c657cdcb5641244ece871e8d6 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Sun, 30 Jan 2022 16:49:00 +0400 Subject: [PATCH] Renamed 404.html to error.html 404.html no longer contains anything specific to the 404 error and will henceforth serve (with some enhancements) as a general purpose error page template. --- src/server/response.cpp | 4 +--- src/server/response.h | 1 - static/resources_list.txt | 2 +- static/templates/{404.html => error.html} | 0 4 files changed, 2 insertions(+), 5 deletions(-) rename static/templates/{404.html => error.html} (100%) diff --git a/src/server/response.cpp b/src/server/response.cpp index 74d8ff9f..49caed53 100644 --- a/src/server/response.cpp +++ b/src/server/response.cpp @@ -100,14 +100,13 @@ std::unique_ptr ContentResponseBlueprint::generateResponseObjec HTTPErrorHtmlResponse::HTTPErrorHtmlResponse(const InternalServer& server, const RequestContext& request, int httpStatusCode, - const std::string& templateStr, const std::string& pageTitleMsg, const std::string& headingMsg) : ContentResponseBlueprint(&server, &request, httpStatusCode, "text/html; charset=utf-8", - templateStr) + RESOURCE::templates::error_html) { kainjow::mustache::list emptyList; this->m_data = kainjow::mustache::object{ @@ -122,7 +121,6 @@ HTTP404HtmlResponse::HTTP404HtmlResponse(const InternalServer& server, : HTTPErrorHtmlResponse(server, request, MHD_HTTP_NOT_FOUND, - RESOURCE::templates::_404_html, "Content not found", "Not Found") { diff --git a/src/server/response.h b/src/server/response.h index 7481cbdd..245c1396 100644 --- a/src/server/response.h +++ b/src/server/response.h @@ -184,7 +184,6 @@ struct HTTPErrorHtmlResponse : ContentResponseBlueprint HTTPErrorHtmlResponse(const InternalServer& server, const RequestContext& request, int httpStatusCode, - const std::string& templateStr, const std::string& pageTitleMsg, const std::string& headingMsg); diff --git a/static/resources_list.txt b/static/resources_list.txt index ab583d7a..c51f19ac 100644 --- a/static/resources_list.txt +++ b/static/resources_list.txt @@ -35,8 +35,8 @@ skin/block_external.js skin/search_results.css templates/search_result.html templates/no_search_result.html +templates/error.html templates/400.html -templates/404.html templates/500.html templates/index.html templates/suggestion.json diff --git a/static/templates/404.html b/static/templates/error.html similarity index 100% rename from static/templates/404.html rename to static/templates/error.html