Skip to content

Commit

Permalink
NR-359272: add one safety to path that recordTask takes through notic…
Browse files Browse the repository at this point in the history
…eNetworkRequest
  • Loading branch information
cdillard-NewRelic committed Jan 16, 2025
1 parent 285b4fd commit 86cca04
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Agent/Network/NRMANetworkFacade.mm
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,12 @@ + (void) noticeNetworkRequest:(NSURLRequest*)request
contentType:[NRMANetworkFacade contentType:response]
bytesSent:bytesSent];
NSUInteger modifiedBytesReceived = bytesReceived;
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse*) response;
NSString* header = httpResponse.allHeaderFields[@"Content-Encoding"];
if ([header isEqualToString:@"gzip"]) {
modifiedBytesReceived = [[NRMAHarvesterConnection gzipData:responseData] length];
if (([response isKindOfClass:[NSHTTPURLResponse class]])) {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse*) response;
NSString* header = httpResponse.allHeaderFields[@"Content-Encoding"];
if ([header isEqualToString:@"gzip"]) {
modifiedBytesReceived = [[NRMAHarvesterConnection gzipData:responseData] length];
}
}


Expand Down

0 comments on commit 86cca04

Please sign in to comment.