Bug 1581599 - Http2 response without content-length can be considered stronly framed. r=mayhemer

Differential Revision: https://phabricator.services.mozilla.com/D48463

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Dragana Damjanovic 2019-10-29 23:28:40 +00:00
Родитель cbe6115aca
Коммит a4cc5f503c
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -1035,8 +1035,10 @@ void nsHttpTransaction::Close(nsresult reason) {
// we must no longer reference the connection! find out if the
// connection was being reused before letting it go.
bool connReused = false;
bool isHttp2 = false;
if (mConnection) {
connReused = mConnection->IsReused();
isHttp2 = mConnection->Version() >= HttpVersion::v2_0;
}
mConnected = false;
mTunnelProvider = nullptr;
@ -1112,6 +1114,12 @@ void nsHttpTransaction::Close(nsresult reason) {
}
}
if (!mResponseIsComplete && NS_SUCCEEDED(reason) && isHttp2) {
// Responses without content-length header field are still complete if
// they are transfered over http2 and the stream is properly closed.
mResponseIsComplete = true;
}
if ((mChunkedDecoder || (mContentLength >= int64_t(0))) &&
(NS_SUCCEEDED(reason) && !mResponseIsComplete)) {
NS_WARNING("Partial transfer, incomplete HTTP response received");