diff options
author | Jordan Kiley <jmkiley@users.noreply.github.com> | 2020-02-11 12:46:46 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-11 12:46:46 -0800 |
commit | 2e978d4bd14a9f9379ee6523682b1f51f61735c0 (patch) | |
tree | ce789b622be47016e0fa623e410db4e1a7187aec | |
parent | 541a8eca44340b2048648a166c73f0d90fd16d0e (diff) | |
download | qtlocation-mapboxgl-2e978d4bd14a9f9379ee6523682b1f51f61735c0.tar.gz |
Revert "[ios, macos] Include SKU token for offline requests (#16130) (#16133)"
This reverts commit d85ce77deba12167f1c25a911ef81f44e35daa2a.
-rw-r--r-- | circle.yml | 2 | ||||
-rw-r--r-- | platform/darwin/src/http_file_source.mm | 5 | ||||
-rw-r--r-- | platform/darwin/test/MGLResourceTests.mm | 5 |
3 files changed, 7 insertions, 5 deletions
diff --git a/circle.yml b/circle.yml index 0e2f4c3fb5..7aa497708c 100644 --- a/circle.yml +++ b/circle.yml @@ -1219,7 +1219,7 @@ jobs: - install-ios-packaging-dependencies - run: name: Build dynamic framework for device and simulator - command: make iframework BUILD_DOCS=false + command: make iframework no_output_timeout: 5m - deploy: name: Upload snapshot build to s3 diff --git a/platform/darwin/src/http_file_source.mm b/platform/darwin/src/http_file_source.mm index 6132ba7f9b..a72a97e299 100644 --- a/platform/darwin/src/http_file_source.mm +++ b/platform/darwin/src/http_file_source.mm @@ -207,9 +207,10 @@ NSURL *resourceURLWithAccountType(const Resource& resource, NSInteger accountTyp if (resource.usage == Resource::Usage::Offline) { [queryItems addObject:[NSURLQueryItem queryItemWithName:@"offline" value:@"true"]]; + } else { + // Only add SKU token to requests not tagged as "offline" usage. + [queryItems addObject:[NSURLQueryItem queryItemWithName:@"sku" value:MGLNativeNetworkManager.sharedManager.skuToken]]; } - - [queryItems addObject:[NSURLQueryItem queryItemWithName:@"sku" value:MGLNativeNetworkManager.sharedManager.skuToken]]; if (components.queryItems) { [queryItems addObjectsFromArray:components.queryItems]; diff --git a/platform/darwin/test/MGLResourceTests.mm b/platform/darwin/test/MGLResourceTests.mm index cf6a997cea..7fcccc535c 100644 --- a/platform/darwin/test/MGLResourceTests.mm +++ b/platform/darwin/test/MGLResourceTests.mm @@ -60,12 +60,13 @@ namespace mbgl { for (NSURLQueryItem *item in components.queryItems) { if (([item.name isEqualToString:@"offline"] && [item.value isEqualToString:@"true"]) || ([item.name isEqualToString:@"a"] && [item.value isEqualToString:@"one"]) || - ([item.name isEqualToString:@"b"] && [item.value isEqualToString:@"two"]) || [item.name isEqualToString:@"sku"]) { + ([item.name isEqualToString:@"b"] && [item.value isEqualToString:@"two"])) { foundCount++; } + XCTAssertFalse([item.name isEqualToString:@"sku"]); } - XCTAssert(foundCount == 4); + XCTAssert(foundCount == 3); #else // NOTE: Currently the macOS SDK does not supply the sku or offline query parameters for (NSURLQueryItem *item in components.queryItems) { |