diff options
author | Brad Leege <bleege@gmail.com> | 2015-05-19 14:37:16 -0500 |
---|---|---|
committer | Brad Leege <bleege@gmail.com> | 2015-05-19 14:37:16 -0500 |
commit | f74fe69cb85d544e84d6a7ecab1d742ffdf87828 (patch) | |
tree | 7c113c1de7f0c0385fcfce6f510606755fb3cccd /platform/darwin/http_request_nsurl.mm | |
parent | bd4fca2ec3f7a2f23e03f6fc36e7affb6c6ca292 (diff) | |
parent | ec4cd494cbec94dc5a7c18378897809c8efa0c9b (diff) | |
download | qtlocation-mapboxgl-f74fe69cb85d544e84d6a7ecab1d742ffdf87828.tar.gz |
Merge pull request #1599 from mapbox/1596-non-mapbox-tiles
Adding mapbox.com checking to http requests
Diffstat (limited to 'platform/darwin/http_request_nsurl.mm')
-rw-r--r-- | platform/darwin/http_request_nsurl.mm | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/platform/darwin/http_request_nsurl.mm b/platform/darwin/http_request_nsurl.mm index 5ab4e1b43e..85d5bffb09 100644 --- a/platform/darwin/http_request_nsurl.mm +++ b/platform/darwin/http_request_nsurl.mm @@ -154,13 +154,15 @@ void HTTPRequest::start() { @autoreleasepool { NSMutableString *url = [NSMutableString stringWithString:@(resource.url.c_str())]; - if ([[NSUserDefaults standardUserDefaults] integerForKey:@"MGLMapboxAccountType"] == 0) { - if ([url rangeOfString:@"?"].location == NSNotFound) { - [url appendString:@"?"]; - } else { - [url appendString:@"&"]; + if ([url rangeOfString:@"mapbox.com"].location != NSNotFound) { + if ([[NSUserDefaults standardUserDefaults] integerForKey:@"MGLMapboxAccountType"] == 0) { + if ([url rangeOfString:@"?"].location == NSNotFound) { + [url appendString:@"?"]; + } else { + [url appendString:@"&"]; + } + [url appendString:@"events=true"]; } - [url appendString:@"events=true"]; } NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]]; |