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,21 +101,25 @@ class RNFetchBlobFetchRepsonse {
101 101
 
102 102
   arrayBuffer(){
103 103
     log.verbose('to arrayBuffer', this.rnfbRespInfo)
104
+    this.bodyUsed = true
104 105
     return readArrayBuffer(this.rnfbResp, this.rnfbRespInfo)
105 106
   }
106 107
 
107 108
   text() {
108 109
     log.verbose('to text', this.rnfbResp, this.rnfbRespInfo)
110
+    this.bodyUsed = true
109 111
     return readText(this.rnfbResp, this.rnfbRespInfo)
110 112
   }
111 113
 
112 114
   json() {
113 115
     log.verbose('to json', this.rnfbResp, this.rnfbRespInfo)
116
+    this.bodyUsed = true
114 117
     return readJSON(this.rnfbResp, this.rnfbRespInfo)
115 118
   }
116 119
 
117 120
   blob() {
118 121
     log.verbose('to blob', this.rnfbResp, this.rnfbRespInfo)
122
+    this.bodyUsed = true
119 123
     return readBlob(this.rnfbResp, this.rnfbRespInfo)
120 124
   }
121 125
 }