8000 Fix Xcode 15 runtime warning · firebase/firebase-ios-sdk@31fdf3a · GitHub
[go: up one dir, main page]

Skip to content

Commit 31fdf3a

Browse files
committed
Fix Xcode 15 runtime warning
1 parent f49a14c commit 31fdf3a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

FirebasePerformance/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 10.16.0
2+
- [fixed] Fix Xcode 15 runtime warning (#11821).
3+
14
# 10.12.0
25
- [fixed] Make Firebase performance compatible with Xcode15.
36
- [changed] Removed the capability to access Carrier information of the device since that API is deprecated by Apple.

FirebasePerformance/Sources/Instrumentation/Network/FPRNSURLSessionInstrument.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,12 @@ void InstrumentUploadTaskWithRequestFromData(FPRNSURLSessionInstrument *instrume
405405
ThrowExceptionBecauseInstrumentHasBeenDeallocated(selector, instrumentor.instrumentedClass);
406406
}
407407
typedef NSURLSessionUploadTask *(*OriginalImp)(id, SEL, NSURLRequest *, NSData *);
408+
// To avoid a runtime warning in Xcode 15, the given `URLRequest`
409+
// should have a nil `HTTPBody`. To workaround this, the `HTTPBody` data is removed.
410+
NSMutableURLRequest *requestWithoutHTTPBody = [request mutableCopy];
411+
requestWithoutHTTPBody.HTTPBody = nil;
408412
NSURLSessionUploadTask *uploadTask =
409-
((OriginalImp)currentIMP)(session, selector, request, bodyData);
413+
((OriginalImp)currentIMP)(session, selector, requestWithoutHTTPBody, bodyData);
410414
if (uploadTask.originalRequest) {
411415
FPRNetworkTrace *trace =
412416
[[FPRNetworkTrace alloc] initWithURLRequest:uploadTask.originalRequest];

0 commit comments

Comments
 (0)
0