From 39de30297b904a889ab5de4bf72cf876fe3b7c6a Mon Sep 17 00:00:00 2001 From: Michal Novotny Date: Thu, 6 Jul 2017 13:38:10 +0200 Subject: [PATCH] Bug 1378308 - nsHttpChannel::GetAlternativeDataType returns alt-data type when delivering data from network, r=valentin When racing cache with network and the network wins, we don't reset mAvailableCachedAltDataType. So when the cache entry has been opened and has alt-data then nsHttpChannel::GetAlternativeDataType returns alt-data type, but we're delivering raw response (no conversion are applied) from the network. --- netwerk/protocol/http/nsHttpChannel.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index b410e64f2519..561413d87732 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -7007,6 +7007,7 @@ nsHttpChannel::OnStartRequest(nsIRequest *request, nsISupports *ctxt) MOZ_ASSERT(request == mTransactionPump); LOG((" First response from network\n")); mFirstResponseSource = RESPONSE_FROM_NETWORK; + mAvailableCachedAltDataType.Truncate(); } else if (WRONG_RACING_RESPONSE_SOURCE(request)) { LOG((" Early return when racing. This response not needed.")); return NS_OK;