plumb trackingName through to native requests

Reviewed By: javache

Differential Revision: D3600752

fbshipit-source-id: 84cea3b67daa67b92a8845454aecf1462c857b50
This commit is contained in:
Scott Wolchok 2016-07-22 11:14:10 -07:00 committed by Facebook Github Bot 0
parent 82c8129627
commit 0e65456d9c
1 changed files with 6 additions and 0 deletions

View File

@ -223,6 +223,12 @@ RCT_EXPORT_MODULE()
request.allHTTPHeaderFields = [self stripNullsInRequestHeaders:[RCTConvert NSDictionary:query[@"headers"]]];
request.timeoutInterval = [RCTConvert NSTimeInterval:query[@"timeout"]];
NSDictionary<NSString *, id> *data = [RCTConvert NSDictionary:RCTNilIfNull(query[@"data"])];
NSString *trackingName = data[@"trackingName"];
if (trackingName) {
[NSURLProtocol setProperty:trackingName
forKey:@"trackingName"
inRequest:request];
}
return [self processDataForHTTPQuery:data callback:^(NSError *error, NSDictionary<NSString *, id> *result) {
if (error) {
RCTLogError(@"Error processing request body: %@", error);