react-native-blob-util 0.16.3 → 0.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -171,6 +171,7 @@ public class ReactNativeBlobUtilReq extends BroadcastReceiver implements Runnabl
|
|
|
171
171
|
private void invoke_callback(Object... args) {
|
|
172
172
|
if (this.callbackfired) return;
|
|
173
173
|
this.callback.invoke(args);
|
|
174
|
+
this.callbackfired = true;
|
|
174
175
|
}
|
|
175
176
|
|
|
176
177
|
private final int QUERY = 1314;
|
|
@@ -296,7 +297,7 @@ public class ReactNativeBlobUtilReq extends BroadcastReceiver implements Runnabl
|
|
|
296
297
|
|
|
297
298
|
// find cached result if `key` property exists
|
|
298
299
|
String cacheKey = this.taskId;
|
|
299
|
-
String ext = this.options.appendExt.isEmpty() ? "" : "." + this.options.appendExt;
|
|
300
|
+
String ext = (this.options.appendExt == null || this.options.appendExt.isEmpty()) ? "" : "." + this.options.appendExt;
|
|
300
301
|
|
|
301
302
|
if (this.options.key != null) {
|
|
302
303
|
cacheKey = ReactNativeBlobUtilUtils.getMD5(this.options.key);
|
|
@@ -401,7 +402,7 @@ public class ReactNativeBlobUtilReq extends BroadcastReceiver implements Runnabl
|
|
|
401
402
|
|
|
402
403
|
if (rawRequestBodyArray != null) {
|
|
403
404
|
requestType = RequestType.Form;
|
|
404
|
-
} else if (cType.isEmpty()) {
|
|
405
|
+
} else if (cType == null || cType.isEmpty()) {
|
|
405
406
|
if (!cType.equalsIgnoreCase("")) {
|
|
406
407
|
builder.header("Content-Type", "application/octet-stream");
|
|
407
408
|
}
|
|
@@ -27,7 +27,7 @@ public class MimeType {
|
|
|
27
27
|
public static String getFullFileName(String name, String mimeType) {
|
|
28
28
|
// Prior to API 29, MimeType.BINARY_FILE has no file extension
|
|
29
29
|
String ext = MimeType.getExtensionFromMimeType(mimeType);
|
|
30
|
-
if (ext.isEmpty() || name.endsWith("." + "ext")) return name;
|
|
30
|
+
if ((ext == null || ext.isEmpty()) || name.endsWith("." + "ext")) return name;
|
|
31
31
|
else {
|
|
32
32
|
String fn = name + "." + ext;
|
|
33
33
|
if (fn.endsWith(".")) return StringUtils.stripEnd(fn, ".");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-blob-util",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.4",
|
|
4
4
|
"description": "A module provides upload, download, and files access API. Supports file stream read/write for process large files.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"base-64": "0.1.0",
|
|
11
|
-
"glob": "^7.
|
|
11
|
+
"glob": "^7.2.3"
|
|
12
12
|
},
|
|
13
13
|
"keywords": [
|
|
14
14
|
"react-native",
|