mirror of https://github.com/kiwix/libkiwix.git
A new overload of Response::build_404()
This commit is contained in:
parent
26c16bb1b2
commit
8cfcf2ea86
|
@ -92,12 +92,18 @@ std::unique_ptr<ContentResponse> Response::build_404(const InternalServer& serve
|
|||
}
|
||||
data.set("details", details);
|
||||
|
||||
return build_404(server, data);
|
||||
}
|
||||
|
||||
std::unique_ptr<ContentResponse> Response::build_404(const InternalServer& server, const kainjow::mustache::data& data)
|
||||
{
|
||||
auto response = ContentResponse::build(server, RESOURCE::templates::_404_html, data, "text/html");
|
||||
response->set_code(MHD_HTTP_NOT_FOUND);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
std::unique_ptr<Response> Response::build_416(const InternalServer& server, size_t resourceLength)
|
||||
{
|
||||
auto response = Response::build(server);
|
||||
|
|
|
@ -51,6 +51,7 @@ class Response {
|
|||
|
||||
static std::unique_ptr<Response> build(const InternalServer& server);
|
||||
static std::unique_ptr<Response> build_304(const InternalServer& server, const ETag& etag);
|
||||
static std::unique_ptr<ContentResponse> build_404(const InternalServer& server, const kainjow::mustache::data& data);
|
||||
static std::unique_ptr<ContentResponse> build_404(const InternalServer& server, const std::string& url, const std::string& details="");
|
||||
static std::unique_ptr<Response> build_416(const InternalServer& server, size_t resourceLength);
|
||||
static std::unique_ptr<Response> build_500(const InternalServer& server, const std::string& msg);
|
||||
|
|
Loading…
Reference in New Issue