Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Revert "[ios, macos] Include SKU token for offline requests (#16130) (#…
Browse files Browse the repository at this point in the history
…16133)"

This reverts commit d85ce77.
  • Loading branch information
jmkiley authored Feb 11, 2020
1 parent 541a8ec commit 2e978d4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions platform/darwin/src/http_file_source.mm
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,10 @@ BOOL isValidMapboxEndpoint(NSURL *url) {

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];
Expand Down
5 changes: 3 additions & 2 deletions platform/darwin/test/MGLResourceTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ - (void)testOfflineQueryParameterIsAddedForOfflineResource {
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) {
Expand Down

0 comments on commit 2e978d4

Please sign in to comment.