mirror of https://github.com/kiwix/libkiwix.git
Changed the return type of Response::build_404()
This commit is contained in:
parent
96cbd2bf26
commit
d487c78ea4
|
@ -83,7 +83,7 @@ std::unique_ptr<Response> Response::build_304(const InternalServer& server, cons
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<Response> Response::build_404(const InternalServer& server, const std::string& url, const std::string& bookName, const std::string& bookTitle, const std::string& details)
|
std::unique_ptr<ContentResponse> Response::build_404(const InternalServer& server, const std::string& url, const std::string& bookName, const std::string& bookTitle, const std::string& details)
|
||||||
{
|
{
|
||||||
MustacheData results;
|
MustacheData results;
|
||||||
if ( !url.empty() ) {
|
if ( !url.empty() ) {
|
||||||
|
@ -95,7 +95,7 @@ std::unique_ptr<Response> Response::build_404(const InternalServer& server, cons
|
||||||
response->set_code(MHD_HTTP_NOT_FOUND);
|
response->set_code(MHD_HTTP_NOT_FOUND);
|
||||||
response->set_taskbar(bookName, bookTitle);
|
response->set_taskbar(bookName, bookTitle);
|
||||||
|
|
||||||
return std::move(response);
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<Response> Response::build_416(const InternalServer& server, size_t resourceLength)
|
std::unique_ptr<Response> Response::build_416(const InternalServer& server, size_t resourceLength)
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace kiwix {
|
||||||
class InternalServer;
|
class InternalServer;
|
||||||
class RequestContext;
|
class RequestContext;
|
||||||
|
|
||||||
class EntryResponse;
|
class ContentResponse;
|
||||||
|
|
||||||
class Response {
|
class Response {
|
||||||
public:
|
public:
|
||||||
|
@ -47,7 +47,7 @@ class Response {
|
||||||
|
|
||||||
static std::unique_ptr<Response> build(const InternalServer& server);
|
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<Response> build_304(const InternalServer& server, const ETag& etag);
|
||||||
static std::unique_ptr<Response> build_404(const InternalServer& server, const std::string& url, const std::string& bookName, const std::string& bookTitle, const std::string& details="");
|
static std::unique_ptr<ContentResponse> build_404(const InternalServer& server, const std::string& url, const std::string& bookName, const std::string& bookTitle, const std::string& details="");
|
||||||
static std::unique_ptr<Response> build_416(const InternalServer& server, size_t resourceLength);
|
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);
|
static std::unique_ptr<Response> build_500(const InternalServer& server, const std::string& msg);
|
||||||
static std::unique_ptr<Response> build_redirect(const InternalServer& server, const std::string& redirectUrl);
|
static std::unique_ptr<Response> build_redirect(const InternalServer& server, const std::string& redirectUrl);
|
||||||
|
|
Loading…
Reference in New Issue