This repository was archived by the owner on Mar 16, 2019. It is now read-only.
File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -201,16 +201,18 @@ void __block (^getFieldData)(id field) = ^(id field)
201
201
RCTLogWarn (@" RNFetchBlob multipart request builder has found a field without `data` or `name` property, the field will be removed implicitly." );
202
202
return ;
203
203
}
204
- contentType = contentType == nil ? @" application/octet-stream " : contentType;
204
+
205
205
// field is a text field
206
206
if ([field valueForKey: @" filename" ] == nil || content == nil ) {
207
+ contentType = contentType == nil ? @" text/plain" : contentType;
207
208
[formData appendData: [[NSString stringWithFormat: @" --%@ \r\n " , boundary] dataUsingEncoding: NSUTF8StringEncoding]];
208
209
[formData appendData: [[NSString stringWithFormat: @" Content-Disposition: form-data; name=\" %@ \"\r\n " , name] dataUsingEncoding: NSUTF8StringEncoding]];
209
- [formData appendData: [[NSString stringWithFormat: @" Content-Type: text/plain \r\n\r\n " ] dataUsingEncoding: NSUTF8StringEncoding]];
210
+ [formData appendData: [[NSString stringWithFormat: @" Content-Type: %@ \r\n\r\n " , contentType ] dataUsingEncoding: NSUTF8StringEncoding]];
210
211
[formData appendData: [[NSString stringWithFormat: @" %@ \r\n " , content] dataUsingEncoding: NSUTF8StringEncoding]];
211
212
}
212
213
// field contains a file
213
214
else {
215
+ contentType = contentType == nil ? @" application/octet-stream" : contentType;
214
216
NSMutableData * blobData;
215
217
if (content != nil )
216
218
{
You can’t perform that action at this time.
0 commit comments