Browse Source

Fix "Content-Encoding" header is always created.

Was side effect of operator[]
adaptive-webui-19844
Chocobo1 8 years ago
parent
commit
129172453b
  1. 2
      src/base/http/responsegenerator.cpp

2
src/base/http/responsegenerator.cpp

@ -37,7 +37,7 @@
QByteArray Http::toByteArray(Response response) 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. // A gzip seems to have 23 bytes overhead.
// Also "Content-Encoding: gzip\r\n" is 26 bytes long // 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 // So we only benefit from gzip if the message is bigger than 23+26 = 49

Loading…
Cancel
Save