mirror of https://github.com/kiwix/libkiwix.git
Dropped ContentResponse::contentDecorationAllowed()
This commit is contained in:
parent
a674561110
commit
6cc677b8ad
|
@ -329,16 +329,6 @@ ContentResponse::can_compress(const RequestContext& request) const
|
|||
&& (m_content.size() > KIWIX_MIN_CONTENT_SIZE_TO_COMPRESS);
|
||||
}
|
||||
|
||||
bool
|
||||
ContentResponse::contentDecorationAllowed() const
|
||||
{
|
||||
if (m_raw) {
|
||||
return false;
|
||||
}
|
||||
return (startsWith(m_mimeType, "text/html")
|
||||
&& m_mimeType.find(";raw=true") == std::string::npos);
|
||||
}
|
||||
|
||||
MHD_Response*
|
||||
Response::create_mhd_response(const RequestContext& request)
|
||||
{
|
||||
|
@ -388,13 +378,11 @@ MHD_Result Response::send(const RequestContext& request, MHD_Connection* connect
|
|||
return ret;
|
||||
}
|
||||
|
||||
ContentResponse::ContentResponse(const std::string& root, bool verbose, bool raw, bool blockExternalLinks, const std::string& content, const std::string& mimetype) :
|
||||
ContentResponse::ContentResponse(const std::string& root, bool verbose, const std::string& content, const std::string& mimetype) :
|
||||
Response(verbose),
|
||||
m_root(root),
|
||||
m_content(content),
|
||||
m_mimeType(mimetype),
|
||||
m_raw(raw),
|
||||
m_blockExternalLinks(blockExternalLinks)
|
||||
m_mimeType(mimetype)
|
||||
{
|
||||
add_header(MHD_HTTP_HEADER_CONTENT_TYPE, m_mimeType);
|
||||
}
|
||||
|
@ -408,8 +396,6 @@ std::unique_ptr<ContentResponse> ContentResponse::build(
|
|||
return std::unique_ptr<ContentResponse>(new ContentResponse(
|
||||
server.m_root,
|
||||
server.m_verbose.load(),
|
||||
raw,
|
||||
server.m_blockExternalLinks,
|
||||
content,
|
||||
mimetype));
|
||||
}
|
||||
|
|
|
@ -83,8 +83,6 @@ class ContentResponse : public Response {
|
|||
ContentResponse(
|
||||
const std::string& root,
|
||||
bool verbose,
|
||||
bool raw,
|
||||
bool blockExternalLinks,
|
||||
const std::string& content,
|
||||
const std::string& mimetype);
|
||||
|
||||
|
@ -104,15 +102,12 @@ class ContentResponse : public Response {
|
|||
MHD_Response* create_mhd_response(const RequestContext& request);
|
||||
|
||||
bool can_compress(const RequestContext& request) const;
|
||||
bool contentDecorationAllowed() const;
|
||||
|
||||
|
||||
private:
|
||||
std::string m_root;
|
||||
std::string m_content;
|
||||
std::string m_mimeType;
|
||||
bool m_raw;
|
||||
bool m_blockExternalLinks;
|
||||
};
|
||||
|
||||
class ContentResponseBlueprint
|
||||
|
|
Loading…
Reference in New Issue