Selaa lähdekoodia

Update RNFetchBlobBody.java

hhravn 8 vuotta sitten
vanhempi
commit
21ce02fc94

+ 2
- 2
src/android/src/main/java/com/RNFetchBlob/RNFetchBlobBody.java Näytä tiedosto

@@ -196,7 +196,7 @@ public class RNFetchBlobBody extends RequestBody{
196 196
             // form begin
197 197
             String header = "--" + boundary + "\r\n";
198 198
             if (field.filename != null) {
199
-                header += "Content-Disposition: form-data; name=" + name + "; filename=" + field.filename + "\r\n";
199
+                header += "Content-Disposition: form-data; name=\"" + name + "\"; filename=" + field.filename + "\r\n";
200 200
                 header += "Content-Type: " + field.mime + "\r\n\r\n";
201 201
                 os.write(header.getBytes());
202 202
                 // file field header end
@@ -235,7 +235,7 @@ public class RNFetchBlobBody extends RequestBody{
235 235
             }
236 236
             // data field
237 237
             else {
238
-                header += "Content-Disposition: form-data; name=" + name + "\r\n";
238
+                header += "Content-Disposition: form-data; name=\"" + name + "\"\r\n";
239 239
                 header += "Content-Type: " + field.mime + "\r\n\r\n";
240 240
                 os.write(header.getBytes());
241 241
                 byte[] fieldData = field.data.getBytes();