Browse Source

Always send Content-Length header.

Because without it, HTTP/1.1 (with persistence connection) clients will
keep waiting for more data.
adaptive-webui-19844
Chocobo1 8 years ago
parent
commit
9496b2a159
  1. 3
      src/base/http/responsegenerator.cpp

3
src/base/http/responsegenerator.cpp

@ -48,8 +48,7 @@ QByteArray ResponseGenerator::generate(Response response)
response.headers.remove(HEADER_CONTENT_ENCODING); response.headers.remove(HEADER_CONTENT_ENCODING);
} }
if (response.content.length() > 0) response.headers[HEADER_CONTENT_LENGTH] = QString::number(response.content.length());
response.headers[HEADER_CONTENT_LENGTH] = QString::number(response.content.length());
QString ret(QLatin1String("HTTP/1.1 %1 %2\r\n%3\r\n")); QString ret(QLatin1String("HTTP/1.1 %1 %2\r\n%3\r\n"));

Loading…
Cancel
Save