From 7ec08017292e9346592620a768182bc4315807bf Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Wed, 12 Sep 2018 22:08:32 +0100 Subject: [PATCH] fix: expect Network.responseReceived event is never dispatched (#3233) Fixes #2888. --- lib/NetworkManager.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/NetworkManager.js b/lib/NetworkManager.js index 74974ffa264..965db9ee674 100644 --- a/lib/NetworkManager.js +++ b/lib/NetworkManager.js @@ -249,7 +249,11 @@ class NetworkManager extends EventEmitter { // @see https://crbug.com/750469 if (!request) return; - request.response()._bodyLoadedPromiseFulfill.call(null); + + // Under certain conditions we never get the Network.responseReceived + // event from protocol. @see https://crbug.com/883475 + if (request.response()) + request.response()._bodyLoadedPromiseFulfill.call(null); this._requestIdToRequest.delete(request._requestId); this._attemptedAuthentications.delete(request._interceptionId); this.emit(NetworkManager.Events.RequestFinished, request);