Refactoring: utilized is_compressible_mime_type()

This commit is contained in:
Veloman Yunkan 2020-04-29 18:33:01 +04:00
parent 9ec7757efe
commit 81e781133d
1 changed files with 1 additions and 4 deletions

View File

@ -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) {