fix: handle extraInfo events even if event.hasExtraInfo === false (#7808)

Issues: #7805
This commit is contained in:
Alex Rudenko 2021-11-29 20:46:02 +01:00 committed by GitHub
parent 921c3bcfcf
commit 6ee2feb1ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -513,7 +513,7 @@ export class NetworkManager extends EventEmitter {
_emitResponseEvent( _emitResponseEvent(
responseReceived: Protocol.Network.ResponseReceivedEvent, responseReceived: Protocol.Network.ResponseReceivedEvent,
extraInfo: Protocol.Network.ResponseReceivedExtraInfoEvent extraInfo: Protocol.Network.ResponseReceivedExtraInfoEvent | null
): void { ): void {
const request = this._requestIdToRequest.get(responseReceived.requestId); const request = this._requestIdToRequest.get(responseReceived.requestId);
// FileUpload sends a response without a matching request. // FileUpload sends a response without a matching request.
@ -523,8 +523,11 @@ export class NetworkManager extends EventEmitter {
responseReceived.requestId responseReceived.requestId
); );
if (extraInfos.length) { if (extraInfos.length) {
throw new Error( debugError(
'Unexpected extraInfo events for request ' + responseReceived.requestId new Error(
'Unexpected extraInfo events for request ' +
responseReceived.requestId
)
); );
} }