From c306fdff7794d479945c4d7442c08998b7504c4d Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Thu, 31 Jan 2019 10:26:37 +0100 Subject: http2: skip content-length for content-encoding: gzip/deflate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The protocol handler now matches HTTP/1.1's protocol handler. Change-Id: Id55c10900e2bcd46e5dc65c63db77097eb4818b6 Fixes: QTBUG-73364 Reviewed-by: Edward Welbourne Reviewed-by: MÃ¥rten Nordheim --- src/network/access/qhttp2protocolhandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/network') diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp index df7f87efd4..d5221a4934 100644 --- a/src/network/access/qhttp2protocolhandler.cpp +++ b/src/network/access/qhttp2protocolhandler.cpp @@ -1056,6 +1056,7 @@ void QHttp2ProtocolHandler::updateStream(Stream &stream, const HPack::HttpHeader Qt::ConnectionType connectionType) { const auto httpReply = stream.reply(); + const auto &httpRequest = stream.request(); Q_ASSERT(httpReply || stream.state == Stream::remoteReserved); if (!httpReply) { @@ -1115,6 +1116,9 @@ void QHttp2ProtocolHandler::updateStream(Stream &stream, const HPack::HttpHeader if (QHttpNetworkReply::isHttpRedirect(statusCode) && redirectUrl.isValid()) httpReply->setRedirectUrl(redirectUrl); + if (httpReplyPrivate->isCompressed() && httpRequest.d->autoDecompress) + httpReplyPrivate->removeAutoDecompressHeader(); + if (QHttpNetworkReply::isHttpRedirect(statusCode) || statusCode == 401 || statusCode == 407) { // These are the status codes that can trigger uploadByteDevice->reset() -- cgit v1.2.3