|
@@ -54,8 +54,8 @@
|
54
|
54
|
[request setHTTPBody:postData];
|
55
|
55
|
}
|
56
|
56
|
// set content-length
|
57
|
|
- [mheaders setValue:[NSString stringWithFormat:@"%d",[postData length]] forKey:@"Content-Length"];
|
58
|
|
- [mheaders setValue:[NSString stringWithFormat:@"100-continue",[postData length]] forKey:@"Expect"];
|
|
57
|
+ [mheaders setValue:[NSString stringWithFormat:@"%lu",[postData length]] forKey:@"Content-Length"];
|
|
58
|
+ [mheaders setValue:@"100-continue" forKey:@"Expect"];
|
59
|
59
|
// appaned boundary to content-type
|
60
|
60
|
[mheaders setValue:[NSString stringWithFormat:@"multipart/form-data; charset=utf-8; boundary=%@", boundary] forKey:@"content-type"];
|
61
|
61
|
[request setHTTPMethod: method];
|
|
@@ -176,12 +176,12 @@
|
176
|
176
|
{
|
177
|
177
|
i++;
|
178
|
178
|
getFieldData([form objectAtIndex:i]);
|
179
|
|
- RCTLogWarn(@"RNFetchBlob multipart request builder has found a field without `data` or `name` property, the field will be removed implicitly.", field);
|
|
179
|
+ RCTLogWarn(@"RNFetchBlob multipart request builder has found a field without `data` or `name` property, the field will be removed implicitly.");
|
180
|
180
|
return;
|
181
|
181
|
}
|
182
|
182
|
contentType = contentType == nil ? @"application/octet-stream" : contentType;
|
183
|
183
|
// field is a text field
|
184
|
|
- if([field valueForKey:@"filename"] == nil || content == [NSNull null]) {
|
|
184
|
+ if([field valueForKey:@"filename"] == nil || content == nil) {
|
185
|
185
|
[formData appendData:[[NSString stringWithFormat:@"--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
|
186
|
186
|
[formData appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"\r\n", name] dataUsingEncoding:NSUTF8StringEncoding]];
|
187
|
187
|
[formData appendData:[[NSString stringWithFormat:@"Content-Type: text/plain\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
|
|
@@ -247,7 +247,7 @@
|
247
|
247
|
}
|
248
|
248
|
}
|
249
|
249
|
|
250
|
|
-+(NSString *) getHeaderIgnoreCases:(NSString *)field fromHeaders:(NSMutableArray *) headers {
|
|
250
|
++(NSString *) getHeaderIgnoreCases:(NSString *)field fromHeaders:(NSMutableDictionary *) headers {
|
251
|
251
|
|
252
|
252
|
NSString * normalCase = [headers valueForKey:field];
|
253
|
253
|
NSString * ignoredCase = [headers valueForKey:[field lowercaseString]];
|