mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-08-03 02:06:05 -04:00
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…
x
Reference in New Issue
Block a user