From 129172453bd5bbd3ff9c4060ef117f220340ee8f Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Thu, 13 Apr 2017 16:20:58 +0800 Subject: [PATCH] Fix "Content-Encoding" header is always created. Was side effect of operator[] --- src/base/http/responsegenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/http/responsegenerator.cpp b/src/base/http/responsegenerator.cpp index e63c2fbcf..cee8c3df7 100644 --- a/src/base/http/responsegenerator.cpp +++ b/src/base/http/responsegenerator.cpp @@ -37,7 +37,7 @@ QByteArray Http::toByteArray(Response response) { - if (response.headers[HEADER_CONTENT_ENCODING] == "gzip") { + if (response.headers.value(HEADER_CONTENT_ENCODING) == "gzip") { // A gzip seems to have 23 bytes overhead. // Also "Content-Encoding: gzip\r\n" is 26 bytes long // So we only benefit from gzip if the message is bigger than 23+26 = 49