mirror of https://github.com/kiwix/libkiwix.git
Refactoring: utilized is_compressible_mime_type()
This commit is contained in:
parent
9ec7757efe
commit
81e781133d
|
@ -179,10 +179,7 @@ Response::create_raw_content_mhd_response(const RequestContext& request)
|
|||
}
|
||||
|
||||
bool shouldCompress = m_compress && request.can_compress();
|
||||
shouldCompress &= m_mimeType.find("text/") != string::npos
|
||||
|| m_mimeType.find("application/javascript") != string::npos
|
||||
|| m_mimeType.find("application/json") != string::npos;
|
||||
|
||||
shouldCompress &= is_compressible_mime_type(m_mimeType);
|
||||
shouldCompress &= (m_content.size() > KIWIX_MIN_CONTENT_SIZE_TO_DEFLATE);
|
||||
|
||||
if (shouldCompress) {
|
||||
|
|
Loading…
Reference in New Issue