Do not fail when onHeadersProcessed is called with no stored pending request.

This commit is contained in:
hackademix 2018-08-23 22:55:26 +02:00
parent c2067c0509
commit 483fad9b8a
1 changed files with 10 additions and 3 deletions

View File

@ -369,12 +369,19 @@ var RequestGuard = (() => {
// check for duplicate calls
let pending = pendingRequests.get(request.requestId);
if (pending && pending.headersProcessed) {
debug("[WARNING] already processed ", request);
if (pending) {
if (pending.headersProcessed) {
debug("[WARNING] already processed ", request);
} else {
debug("onHeadersReceived", request);
}
} else {
debug("[WARNING] no pending information for ", request);
initPendingRequest(request);
pending = pendingRequests.get(request.requestId);
}
pending.headersProcessed = true;
debug("onHeadersReceived", request);
let {url, documentUrl, statusCode, tabId, responseHeaders} = request;
try {