From b909dd41c5559d1df474ac4b4afe6607c9cfa086 Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Sat, 9 Nov 2013 20:02:31 +0200 Subject: [PATCH] Small optimization of WebUI responses when there isn't a data payload. --- src/webui/httpresponsegenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webui/httpresponsegenerator.cpp b/src/webui/httpresponsegenerator.cpp index eed78643e..91d15c28b 100644 --- a/src/webui/httpresponsegenerator.cpp +++ b/src/webui/httpresponsegenerator.cpp @@ -119,7 +119,7 @@ bool HttpResponseGenerator::gCompress(QByteArray &dest_buffer) { } QByteArray HttpResponseGenerator::toByteArray() { - if (m_gzip) { + if (m_gzip && m_message.size() > 0) {// prevents writing a useless and wasteful header QByteArray dest_buf; if (gCompress(dest_buf)) { setValue("content-encoding", "gzip");