From 08f8403dc43ad34320ee3038fa877a92b2b735c3 Mon Sep 17 00:00:00 2001 From: Ben Hsieh Date: Mon, 3 Jul 2017 08:48:44 +0800 Subject: [PATCH] Fixed a bug which causes XMLHttpRequest getting incorrect header when sending multiple requests in the same time --- polyfill/XMLHttpRequest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyfill/XMLHttpRequest.js b/polyfill/XMLHttpRequest.js index 89171921f..42c987704 100644 --- a/polyfill/XMLHttpRequest.js +++ b/polyfill/XMLHttpRequest.js @@ -277,7 +277,7 @@ export default class XMLHttpRequest extends XMLHttpRequestEventTarget{ _headerReceived = (e) => { log.debug('header received ', this._task.taskId, e) this.responseURL = this._url - if(e.state === "2") { + if(e.state === "2" && e.taskId === this._task.taskId) { this._responseHeaders = e.headers this._statusText = e.status this._status = Math.floor(e.status)