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

Commit bd118af

Browse files
authored
Merge pull request #182 from TeletronicsDotAe/issue-181
multipart/form-data should use quoted-string syntax
2 parents 5b3d2a9 + 21ce02f commit bd118af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ private File createMultipartBodyCache() throws IOException {
196196
// form begin
197197
String header = "--" + boundary + "\r\n";
198198
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";
200200
header += "Content-Type: " + field.mime + "\r\n\r\n";
201201
os.write(header.getBytes());
202202
// file field header end
@@ -235,7 +235,7 @@ private File createMultipartBodyCache() throws IOException {
235235
}
236236
// data field
237237
else {
238-
header += "Content-Disposition: form-data; name=" + name + "\r\n";
238+
header += "Content-Disposition: form-data; name=\"" + name + "\"\r\n";
239239
header += "Content-Type: " + field.mime + "\r\n\r\n";
240240
os.write(header.getBytes());
241241
byte[] fieldData = field.data.getBytes();

0 commit comments

Comments
 (0)