ソースを参照

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 5 年 前
コミット
c31cb90f3d
共有1 個のファイルを変更した3 個の追加1 個の削除を含む
  1. 3
    1
      android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java

+ 3
- 1
android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java ファイルの表示

@@ -266,7 +266,9 @@ public class RNFetchBlobReq extends BroadcastReceiver implements Runnable {
266 266
                     requestType = RequestType.Form;
267 267
                 }
268 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 272
                     requestType = RequestType.SingleFile;
271 273
                 }
272 274
                 if(rawRequestBody != null) {