瀏覽代碼

Fixed a bug which causes XMLHttpRequest getting incorrect header when sending multiple requests in the same time

Ben Hsieh 7 年之前
父節點
當前提交
08f8403dc4
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      polyfill/XMLHttpRequest.js

+ 1
- 1
polyfill/XMLHttpRequest.js 查看文件

@@ -277,7 +277,7 @@ export default class XMLHttpRequest extends XMLHttpRequestEventTarget{
277 277
   _headerReceived = (e) => {
278 278
     log.debug('header received ', this._task.taskId, e)
279 279
     this.responseURL = this._url
280
-    if(e.state === "2") {
280
+    if(e.state === "2" && e.taskId === this._task.taskId) {
281 281
       this._responseHeaders = e.headers
282 282
       this._statusText = e.status
283 283
       this._status = Math.floor(e.status)