From 7f35cff098ac5d6e94b75fed64c5abeb39e44fd9 Mon Sep 17 00:00:00 2001 From: tatiana-yan Date: Mon, 7 Oct 2019 11:54:36 +0300 Subject: [PATCH] [platform][linux] Fix content-encoding. --- platform/http_client_curl.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/platform/http_client_curl.cpp b/platform/http_client_curl.cpp index 7add191acf..919eb6039e 100644 --- a/platform/http_client_curl.cpp +++ b/platform/http_client_curl.cpp @@ -285,13 +285,16 @@ bool HttpClient::RunHttpRequest() m_serverResponse = move(redirect.m_serverResponse); } - auto const it = m_headers.find("content-encoding"); - if (it != m_headers.end()) + for (auto const & header : headers) { - m_serverResponse = Decompress(m_serverResponse, it->second); - LOG(LDEBUG, ("Response with", it->second, "is decompressed.")); + if (strings::EqualNoCase(header.first, "content-encoding") && + !strings::EqualNoCase(header.second, "identity")) + { + m_serverResponse = Decompress(m_serverResponse, header.second); + LOG(LDEBUG, ("Response with", header.second, "is decompressed.")); + break; + } } - return true; } } // namespace platform