Browse Source

Change XMLHttpRequest.responseType implementation #144

Ben Hsieh 7 years ago
parent
commit
d8d392c412
1 changed files with 1 additions and 2 deletions
  1. 1
    2
      src/polyfill/XMLHttpRequest.js

+ 1
- 2
src/polyfill/XMLHttpRequest.js View File

@@ -262,7 +262,6 @@ export default class XMLHttpRequest extends XMLHttpRequestEventTarget{
262 262
     if(e.state === "2") {
263 263
       this._responseHeaders = e.headers
264 264
       this._statusText = e.status
265
-      this._responseType = e.respType || ''
266 265
       this._status = Math.floor(e.status)
267 266
       this._dispatchReadStateChange(XMLHttpRequest.HEADERS_RECEIVED)
268 267
     }
@@ -323,7 +322,7 @@ export default class XMLHttpRequest extends XMLHttpRequestEventTarget{
323 322
     if(resp) {
324 323
       let info = resp.respInfo || {}
325 324
       log.debug(this._url, info, info.respType)
326
-      switch(info.respType) {
325
+      switch(this._responseType) {
327 326
         case 'blob' :
328 327
           resp.blob().then((b) => {
329 328
             this._responseText = resp.text()