Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: CFNetwork upload warning setting body twice #240

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/native-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ jobs:
platform: [iOS, tvOS]
scheme: [mParticle-Apple-SDK, mParticle-Apple-SDK-NoLocation]
include:
- xcode: "15.0"
os: "17.0"
- platform: iOS
device: iPhone 14
device: iPhone 15
- platform: tvOS
device: Apple TV
runs-on: macos-13
Expand All @@ -31,4 +29,4 @@ jobs:
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app

- name: Run iOS unit tests
run: xcodebuild -project mParticle-Apple-SDK.xcodeproj -scheme ${{ matrix.scheme }} -destination 'platform=${{ matrix.platform }} Simulator,name=${{ matrix.device }},OS=${{ matrix.os }}' test
run: xcodebuild -project mParticle-Apple-SDK.xcodeproj -scheme ${{ matrix.scheme }} -destination 'platform=${{ matrix.platform }} Simulator,name=${{ matrix.device }},OS=latest' test
8 changes: 3 additions & 5 deletions mParticle-Apple-SDK/Network/MPConnector.m
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,8 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didComp

- (nonnull NSObject<MPConnectorResponseProtocol> *)responseFromPostRequestToURL:(nonnull MPURL *)url message:(nullable NSString *)message serializedParams:(nullable NSData *)serializedParams {
MPConnectorResponse *response = [[MPConnectorResponse alloc] init];

NSMutableURLRequest *urlRequest = [[[MPURLRequestBuilder newBuilderWithURL:url message:message httpMethod:kMPHTTPMethodPost]
withPostData:serializedParams]
build];

NSMutableURLRequest *urlRequest = [[[MPURLRequestBuilder newBuilderWithURL:url message:message httpMethod:kMPHTTPMethodPost] withPostData:serializedParams] build];

if (urlRequest) {
requestStartTime = [NSDate date];
Expand All @@ -261,7 +259,7 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didComp
completionHttpResponse = httpResponse;
dispatch_semaphore_signal(requestSemaphore);
};
self.dataTask = [self.urlSession uploadTaskWithRequest:urlRequest fromData:serializedParams];
self.dataTask = [self.urlSession dataTaskWithRequest:urlRequest];
[_dataTask resume];
long exitCode = dispatch_semaphore_wait(requestSemaphore, dispatch_time(DISPATCH_TIME_NOW, (NETWORK_REQUEST_MAX_WAIT_SECONDS + 1) * NSEC_PER_SEC));
if (exitCode == 0) {
Expand Down