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
…#16191)

* Revert "[ios, macos] Include SKU token for offline requests (#16130) (#16133)"

This reverts commit d85ce77.

* [ios] Keep skipping docs for ios-release
  • Loading branch information
jmkiley committed Feb 11, 2020
1 parent 541a8ec commit 44a350b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
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 44a350b

Please sign in to comment.