Browse Source

Fix Fetch.bodyUsed state #70

Ben Hsieh 8 years ago
parent
commit
273f8eea46
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      src/polyfill/Fetch.js

+ 4
- 0
src/polyfill/Fetch.js View File

101
 
101
 
102
   arrayBuffer(){
102
   arrayBuffer(){
103
     log.verbose('to arrayBuffer', this.rnfbRespInfo)
103
     log.verbose('to arrayBuffer', this.rnfbRespInfo)
104
+    this.bodyUsed = true
104
     return readArrayBuffer(this.rnfbResp, this.rnfbRespInfo)
105
     return readArrayBuffer(this.rnfbResp, this.rnfbRespInfo)
105
   }
106
   }
106
 
107
 
107
   text() {
108
   text() {
108
     log.verbose('to text', this.rnfbResp, this.rnfbRespInfo)
109
     log.verbose('to text', this.rnfbResp, this.rnfbRespInfo)
110
+    this.bodyUsed = true
109
     return readText(this.rnfbResp, this.rnfbRespInfo)
111
     return readText(this.rnfbResp, this.rnfbRespInfo)
110
   }
112
   }
111
 
113
 
112
   json() {
114
   json() {
113
     log.verbose('to json', this.rnfbResp, this.rnfbRespInfo)
115
     log.verbose('to json', this.rnfbResp, this.rnfbRespInfo)
116
+    this.bodyUsed = true
114
     return readJSON(this.rnfbResp, this.rnfbRespInfo)
117
     return readJSON(this.rnfbResp, this.rnfbRespInfo)
115
   }
118
   }
116
 
119
 
117
   blob() {
120
   blob() {
118
     log.verbose('to blob', this.rnfbResp, this.rnfbRespInfo)
121
     log.verbose('to blob', this.rnfbResp, this.rnfbRespInfo)
122
+    this.bodyUsed = true
119
     return readBlob(this.rnfbResp, this.rnfbRespInfo)
123
     return readBlob(this.rnfbResp, this.rnfbRespInfo)
120
   }
124
   }
121
 }
125
 }