mirror of
https://github.com/apache/cordova-plugin-file-transfer.git
synced 2024-10-06 07:42:20 +08:00
fix(ios): headers are not being sent (#284)
This commit is contained in:
parent
24b15c5f5a
commit
dcae9269b8
@ -103,8 +103,6 @@ static CFIndex WriteDataToStream(NSData* data, CFWriteStreamRef stream)
|
|||||||
- (void)applyRequestHeaders:(NSDictionary*)headers toRequest:(NSMutableURLRequest*)req
|
- (void)applyRequestHeaders:(NSDictionary*)headers toRequest:(NSMutableURLRequest*)req
|
||||||
{
|
{
|
||||||
[req setValue:@"XMLHttpRequest" forHTTPHeaderField:@"X-Requested-With"];
|
[req setValue:@"XMLHttpRequest" forHTTPHeaderField:@"X-Requested-With"];
|
||||||
[self.webViewEngine evaluateJavaScript:@"navigator.userAgent" completionHandler:^(NSString* userAgent, NSError* error) {
|
|
||||||
[req setValue:userAgent forHTTPHeaderField:@"User-Agent"];
|
|
||||||
|
|
||||||
for (NSString* headerName in headers) {
|
for (NSString* headerName in headers) {
|
||||||
id value = [headers objectForKey:headerName];
|
id value = [headers objectForKey:headerName];
|
||||||
@ -130,7 +128,6 @@ static CFIndex WriteDataToStream(NSData* data, CFWriteStreamRef stream)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSURLRequest*)requestForUploadCommand:(CDVInvokedUrlCommand*)command fileData:(NSData*)fileData
|
- (NSURLRequest*)requestForUploadCommand:(CDVInvokedUrlCommand*)command fileData:(NSData*)fileData
|
||||||
|
Loading…
Reference in New Issue
Block a user