summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorBrad Leege <bleege@gmail.com>2015-05-19 14:23:21 -0500
committerBrad Leege <bleege@gmail.com>2015-05-19 14:23:21 -0500
commitec4cd494cbec94dc5a7c18378897809c8efa0c9b (patch)
tree7c113c1de7f0c0385fcfce6f510606755fb3cccd /platform
parentbd4fca2ec3f7a2f23e03f6fc36e7affb6c6ca292 (diff)
downloadqtlocation-mapboxgl-ec4cd494cbec94dc5a7c18378897809c8efa0c9b.tar.gz
#1596 - Adding mapbox.com checking to http requests
Diffstat (limited to 'platform')
-rw-r--r--platform/darwin/http_request_nsurl.mm14
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]];