Browse Source

change android request builder so it wont set Content-Type header to application/octet-stream if it was explicitly set to the empty string. This fixes amazon s3 uploads with a presigned url

Lorien 6 years ago
parent
commit
c31cb90f3d
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java

+ 3
- 1
android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java View File

266
                     requestType = RequestType.Form;
266
                     requestType = RequestType.Form;
267
                 }
267
                 }
268
                 else if(cType.isEmpty()) {
268
                 else if(cType.isEmpty()) {
269
-                    builder.header("Content-Type", "application/octet-stream");
269
+                    if(!cType.equalsIgnoreCase("")) {
270
+                      builder.header("Content-Type", "application/octet-stream");
271
+                    }
270
                     requestType = RequestType.SingleFile;
272
                     requestType = RequestType.SingleFile;
271
                 }
273
                 }
272
                 if(rawRequestBody != null) {
274
                 if(rawRequestBody != null) {