Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit c6752b4

Browse files
committed
Fix Android content type checking mechanism
1 parent db5b690 commit c6752b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ else if(this.options.fileCache == true)
207207
}
208208

209209
if(method.equalsIgnoreCase("post") || method.equalsIgnoreCase("put")) {
210-
String cType = getHeaderIgnoreCases(mheaders, "content-type").toLowerCase();
210+
String cType = getHeaderIgnoreCases(mheaders, "Content-Type").toLowerCase();
211211

212212
if(cType == null) {
213213
builder.header("Content-Type", "application/octet-stream");
@@ -217,7 +217,7 @@ else if(this.options.fileCache == true)
217217
if(rawRequestBody.startsWith(RNFetchBlobConst.FILE_PREFIX)) {
218218
requestType = RequestType.SingleFile;
219219
}
220-
else if (cType.contains(";base64") || cType.startsWith("application/octet")) {
220+
else if (cType.toLowerCase().contains(";base64") || cType.toLowerCase().startsWith("application/octet")) {
221221
requestType = RequestType.SingleFile;
222222
} else {
223223
requestType = RequestType.AsIs;

0 commit comments

Comments
 (0)