Small optimization of WebUI responses when there isn't a data payload.

This commit is contained in:
sledgehammer999 2013-11-09 20:02:31 +02:00
parent c284fd5412
commit b909dd41c5

View file

@ -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");