mirror of https://github.com/kiwix/libkiwix.git
Got rid of isHomePage in ContentResponse::build()
This commit is contained in:
parent
eb0a45b13e
commit
0ce36e6246
|
@ -728,7 +728,6 @@ std::unique_ptr<Response> InternalServer::handle_skin(const RequestContext& requ
|
|||
*this,
|
||||
getResource(resourceName),
|
||||
getMimeTypeForFile(resourceName),
|
||||
/*isHomePage=*/false,
|
||||
/*raw=*/true);
|
||||
response->set_cacheable();
|
||||
return std::move(response);
|
||||
|
@ -820,11 +819,9 @@ std::unique_ptr<Response> InternalServer::handle_search(const RequestContext& re
|
|||
renderer.setPageLength(pageLength);
|
||||
if (request.get_requested_format() == "xml") {
|
||||
return ContentResponse::build(*this, renderer.getXml(), "application/rss+xml; charset=utf-8",
|
||||
/*isHomePage =*/false,
|
||||
/*raw =*/true);
|
||||
}
|
||||
auto response = ContentResponse::build(*this, renderer.getHtml(), "text/html; charset=utf-8",
|
||||
/*isHomePage =*/false,
|
||||
/*raw =*/false);
|
||||
// XXX: Now this has to be handled by the iframe-based viewer which
|
||||
// XXX: has to resolve if the book selection resulted in a single book.
|
||||
|
@ -956,7 +953,6 @@ std::unique_ptr<Response> InternalServer::handle_catalog(const RequestContext& r
|
|||
*this,
|
||||
opdsDumper.dumpOPDSFeed(bookIdsToDump, request.get_query()),
|
||||
"application/atom+xml; profile=opds-catalog; kind=acquisition; charset=utf-8",
|
||||
/*isHomePage*/ false,
|
||||
/*raw*/ true);
|
||||
return std::move(response);
|
||||
}
|
||||
|
@ -1146,7 +1142,6 @@ std::unique_ptr<Response> InternalServer::handle_locally_customized_resource(con
|
|||
return ContentResponse::build(*this,
|
||||
resourceData,
|
||||
crd.mimeType,
|
||||
/*isHomePage=*/false,
|
||||
/*raw=*/true);
|
||||
}
|
||||
|
||||
|
|
|
@ -183,7 +183,7 @@ class InternalServer {
|
|||
std::unique_ptr<CustomizedResources> m_customizedResources;
|
||||
|
||||
friend std::unique_ptr<Response> Response::build(const InternalServer& server);
|
||||
friend std::unique_ptr<ContentResponse> ContentResponse::build(const InternalServer& server, const std::string& content, const std::string& mimetype, bool isHomePage, bool raw);
|
||||
friend std::unique_ptr<ContentResponse> ContentResponse::build(const InternalServer& server, const std::string& content, const std::string& mimetype, bool raw);
|
||||
friend std::unique_ptr<Response> ItemResponse::build(const InternalServer& server, const RequestContext& request, const zim::Item& item, bool raw);
|
||||
};
|
||||
|
||||
|
|
|
@ -104,7 +104,6 @@ std::unique_ptr<Response> InternalServer::handle_catalog_v2_entries(const Reques
|
|||
*this,
|
||||
opdsFeed,
|
||||
"application/atom+xml;profile=opds-catalog;kind=acquisition",
|
||||
/*isHomePage*/ false,
|
||||
/*raw*/ true
|
||||
);
|
||||
}
|
||||
|
@ -126,7 +125,6 @@ std::unique_ptr<Response> InternalServer::handle_catalog_v2_complete_entry(const
|
|||
*this,
|
||||
opdsFeed,
|
||||
"application/atom+xml;type=entry;profile=opds-catalog",
|
||||
/*isHomePage*/ false,
|
||||
/*raw*/ true
|
||||
);
|
||||
}
|
||||
|
@ -140,7 +138,6 @@ std::unique_ptr<Response> InternalServer::handle_catalog_v2_categories(const Req
|
|||
*this,
|
||||
opdsDumper.categoriesOPDSFeed(),
|
||||
"application/atom+xml;profile=opds-catalog;kind=navigation",
|
||||
/*isHomePage*/ false,
|
||||
/*raw*/ true
|
||||
);
|
||||
}
|
||||
|
@ -154,7 +151,6 @@ std::unique_ptr<Response> InternalServer::handle_catalog_v2_languages(const Requ
|
|||
*this,
|
||||
opdsDumper.languagesOPDSFeed(),
|
||||
"application/atom+xml;profile=opds-catalog;kind=navigation",
|
||||
/*isHomePage*/ false,
|
||||
/*raw*/ true
|
||||
);
|
||||
}
|
||||
|
@ -170,7 +166,6 @@ std::unique_ptr<Response> InternalServer::handle_catalog_v2_illustration(const R
|
|||
*this,
|
||||
illustration->getData(),
|
||||
illustration->mimeType,
|
||||
/*isHomePage*/ false,
|
||||
/*raw*/ true
|
||||
);
|
||||
} catch(...) {
|
||||
|
|
|
@ -429,7 +429,6 @@ std::unique_ptr<ContentResponse> ContentResponse::build(
|
|||
const InternalServer& server,
|
||||
const std::string& content,
|
||||
const std::string& mimetype,
|
||||
bool isHomePage,
|
||||
bool raw)
|
||||
{
|
||||
return std::unique_ptr<ContentResponse>(new ContentResponse(
|
||||
|
@ -448,7 +447,7 @@ std::unique_ptr<ContentResponse> ContentResponse::build(
|
|||
const std::string& mimetype)
|
||||
{
|
||||
auto content = render_template(template_str, data);
|
||||
return ContentResponse::build(server, content, mimetype, /*isHomePage*/false, /*raw*/false);
|
||||
return ContentResponse::build(server, content, mimetype, /*raw*/false);
|
||||
}
|
||||
|
||||
ItemResponse::ItemResponse(bool verbose, const zim::Item& item, const std::string& mimetype, const ByteRange& byterange) :
|
||||
|
@ -468,7 +467,7 @@ std::unique_ptr<Response> ItemResponse::build(const InternalServer& server, cons
|
|||
const bool noRange = byteRange.kind() == ByteRange::RESOLVED_FULL_CONTENT;
|
||||
if (noRange && is_compressible_mime_type(mimetype)) {
|
||||
// Return a contentResponse
|
||||
auto response = ContentResponse::build(server, item.getData(), mimetype, /*isHomePage=*/false, raw);
|
||||
auto response = ContentResponse::build(server, item.getData(), mimetype, raw);
|
||||
response->set_cacheable();
|
||||
response->m_byteRange = byteRange;
|
||||
return std::move(response);
|
||||
|
|
|
@ -92,7 +92,6 @@ class ContentResponse : public Response {
|
|||
const InternalServer& server,
|
||||
const std::string& content,
|
||||
const std::string& mimetype,
|
||||
bool isHomePage,
|
||||
bool raw);
|
||||
|
||||
static std::unique_ptr<ContentResponse> build(
|
||||
|
|
Loading…
Reference in New Issue