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

Commit

Permalink
Fix Android content type checking mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
wkh237 committed Jul 31, 2016
1 parent db5b690 commit c6752b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ else if(this.options.fileCache == true)
}

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

if(cType == null) {
builder.header("Content-Type", "application/octet-stream");
Expand All @@ -217,7 +217,7 @@ else if(this.options.fileCache == true)
if(rawRequestBody.startsWith(RNFetchBlobConst.FILE_PREFIX)) {
requestType = RequestType.SingleFile;
}
else if (cType.contains(";base64") || cType.startsWith("application/octet")) {
else if (cType.toLowerCase().contains(";base64") || cType.toLowerCase().startsWith("application/octet")) {
requestType = RequestType.SingleFile;
} else {
requestType = RequestType.AsIs;
Expand Down

0 comments on commit c6752b4

Please sign in to comment.