#1596 - Adding mapbox.com checking to http requests

This commit is contained in:
Brad Leege
2015-05-19 14:23:21 -05:00
parent bd4fca2ec3
commit ec4cd494cb

View File

@@ -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]];