diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2019-01-31 10:26:37 +0100 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2019-02-01 14:32:12 +0000 |
commit | c306fdff7794d479945c4d7442c08998b7504c4d (patch) | |
tree | 87fbad1d329d3723f612755825d5fe640ee131aa /src/network | |
parent | 72b95742270afd30a7dda26344892d69fd8f8249 (diff) |
http2: skip content-length for content-encoding: gzip/deflate
The protocol handler now matches HTTP/1.1's protocol handler.
Change-Id: Id55c10900e2bcd46e5dc65c63db77097eb4818b6
Fixes: QTBUG-73364
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/access/qhttp2protocolhandler.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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() |