summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-05-19 14:33:19 -0700
committerMinh Nguyễn <mxn@1ec5.org>2015-05-19 14:33:19 -0700
commitd474f35371b12d95e2a732d61d1d9f1d9a3f322c (patch)
tree13d117251ab006eb987898e0f02a7e1dc5bf6f18 /platform
parent52670f05601e35804e79f1ee197f2042a9c94a43 (diff)
downloadqtlocation-mapboxgl-d474f35371b12d95e2a732d61d1d9f1d9a3f322c.tar.gz
Check account type before comparing hostname
Diffstat (limited to 'platform')
-rw-r--r--platform/darwin/http_request_nsurl.mm11
1 files changed, 5 insertions, 6 deletions
diff --git a/platform/darwin/http_request_nsurl.mm b/platform/darwin/http_request_nsurl.mm
index ef88469b46..ad16a69acf 100644
--- a/platform/darwin/http_request_nsurl.mm
+++ b/platform/darwin/http_request_nsurl.mm
@@ -157,12 +157,11 @@ void HTTPRequest::start() {
@autoreleasepool {
NSURL *url = [NSURL URLWithString:@(resource.url.c_str())];
- if ([url.host isEqualToString:@"mapbox.com"] || [url.host hasSuffix:@".mapbox.com"]) {
- if (context->accountType == 0) {
- NSString *absoluteString = [url.absoluteString stringByAppendingFormat:
- (url.query ? @"&%@" : @"?%@"), @"events=true"];
- url = [NSURL URLWithString:absoluteString];
- }
+ if (context->accountType == 0 &&
+ ([url.host isEqualToString:@"mapbox.com"] || [url.host hasSuffix:@".mapbox.com"])) {
+ NSString *absoluteString = [url.absoluteString stringByAppendingFormat:
+ (url.query ? @"&%@" : @"?%@"), @"events=true"];
+ url = [NSURL URLWithString:absoluteString];
}
NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url];