|
@@ -6,8 +6,8 @@ import Blob from './Blob'
|
6
|
6
|
|
7
|
7
|
const log = new Log('FetchPolyfill')
|
8
|
8
|
|
9
|
|
-log.disable()
|
10
|
|
-// log.level(3)
|
|
9
|
+// log.disable()
|
|
10
|
+log.level(3)
|
11
|
11
|
|
12
|
12
|
export default class Fetch {
|
13
|
13
|
|
|
@@ -32,7 +32,6 @@ class RNFetchBlobFetchPolyfill {
|
32
|
32
|
options.headers['Content-Type'] = ctype || ctypeH
|
33
|
33
|
options.headers['content-type'] = ctype || ctypeH
|
34
|
34
|
options.method = options.method || 'GET'
|
35
|
|
-
|
36
|
35
|
if(body) {
|
37
|
36
|
// When the request body is an instance of FormData, create a Blob cache
|
38
|
37
|
// to upload the body.
|
|
@@ -55,7 +54,6 @@ class RNFetchBlobFetchPolyfill {
|
55
|
54
|
else
|
56
|
55
|
promise = Promise.resolve(body)
|
57
|
56
|
}
|
58
|
|
-
|
59
|
57
|
// task is a progress reportable and cancellable Promise, however,
|
60
|
58
|
// task.then is not, so we have to extend task.then with progress and
|
61
|
59
|
// cancel function
|
|
@@ -69,7 +67,7 @@ class RNFetchBlobFetchPolyfill {
|
69
|
67
|
log.verbose('response', resp)
|
70
|
68
|
// release blob cache created when sending request
|
71
|
69
|
if(blobCache !== null && blobCache instanceof Blob)
|
72
|
|
- blobCache.close()
|
|
70
|
+ // blobCache.close()
|
73
|
71
|
return Promise.resolve(new RNFetchBlobFetchRepsonse(resp))
|
74
|
72
|
})
|
75
|
73
|
|