Selaa lähdekoodia

Fix appendExt

Ben Hsieh 8 vuotta sitten
vanhempi
commit
6f46cd431d

+ 3
- 2
src/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java Näytä tiedosto

167
 
167
 
168
         // find cached result if `key` property exists
168
         // find cached result if `key` property exists
169
         String cacheKey = this.taskId;
169
         String cacheKey = this.taskId;
170
-        String ext = this.options.appendExt.isEmpty() ? "." + this.options.appendExt : "";
170
+        String ext = this.options.appendExt.isEmpty() ? "" : "." + this.options.appendExt;
171
 
171
 
172
         if (this.options.key != null) {
172
         if (this.options.key != null) {
173
             cacheKey = RNFetchBlobUtils.getMD5(this.options.key);
173
             cacheKey = RNFetchBlobUtils.getMD5(this.options.key);
188
         else if(this.options.fileCache)
188
         else if(this.options.fileCache)
189
             this.destPath = RNFetchBlobFS.getTmpPath(RNFetchBlob.RCTContext, cacheKey) + ext;
189
             this.destPath = RNFetchBlobFS.getTmpPath(RNFetchBlob.RCTContext, cacheKey) + ext;
190
 
190
 
191
+
191
         OkHttpClient.Builder clientBuilder;
192
         OkHttpClient.Builder clientBuilder;
192
 
193
 
193
         try {
194
         try {
497
                     // and write response data to destination path.
498
                     // and write response data to destination path.
498
                     resp.body().bytes();
499
                     resp.body().bytes();
499
                 } catch (Exception ignored) {
500
                 } catch (Exception ignored) {
500
-                    ignored.printStackTrace();
501
+//                    ignored.printStackTrace();
501
                 }
502
                 }
502
                 this.destPath = this.destPath.replace("?append=true", "");
503
                 this.destPath = this.destPath.replace("?append=true", "");
503
                 callback.invoke(null, RNFetchBlobConst.RNFB_RESPONSE_PATH, this.destPath);
504
                 callback.invoke(null, RNFetchBlobConst.RNFB_RESPONSE_PATH, this.destPath);