diff options
author | Brad Leege <bleege@gmail.com> | 2015-04-02 16:57:19 -0500 |
---|---|---|
committer | Brad Leege <bleege@gmail.com> | 2015-04-02 16:57:19 -0500 |
commit | 7c05f941a8c001ad770a79fc2ae59093d0dcdcd2 (patch) | |
tree | 48ce32fcfe29b159e85a4e996a03a5b4ffd31868 | |
parent | 94ed06dacb60cbcf75119ade8479f345a43d3af5 (diff) | |
parent | 94bc3c811fa3ad08a03800a180916c9560cbfd60 (diff) | |
download | qtlocation-mapboxgl-7c05f941a8c001ad770a79fc2ae59093d0dcdcd2.tar.gz |
Merge pull request #1188 from mapbox/1185-events-querystring
Events = True
-rw-r--r-- | platform/darwin/http_request_nsurl.mm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/platform/darwin/http_request_nsurl.mm b/platform/darwin/http_request_nsurl.mm index 638b5062d4..7be5f226fd 100644 --- a/platform/darwin/http_request_nsurl.mm +++ b/platform/darwin/http_request_nsurl.mm @@ -141,8 +141,19 @@ void HTTPRequestImpl::start() { attempts++; @autoreleasepool { + + NSMutableString *url = [[NSMutableString alloc] initWithString:@(request->resource.url.c_str())]; + if ([[NSUserDefaults standardUserDefaults] objectForKey:@"mapbox_metrics_disabled"] == nil) { + if ([url rangeOfString:@"?"].location == NSNotFound) { + [url appendString:@"?"]; + } else { + [url appendString:@"&"]; + } + [url appendString:@"events=true"]; + } + NSMutableURLRequest *req = [[NSMutableURLRequest alloc] - initWithURL:[NSURL URLWithString:@(request->resource.url.c_str())]]; + initWithURL:[NSURL URLWithString:url]]; if (existingResponse) { if (!existingResponse->etag.empty()) { [req addValue:@(existingResponse->etag.c_str()) forHTTPHeaderField:@"If-None-Match"]; |