Never cache the tags API in macOS's HQ Launcher

Prior to this change we used the default session while downloading the
latest tags API response from Thunder. This left open the possibility that
NSURLSession could cache the response, even though the server asked it
not to; NSURLSession can be pretty aggressive about its caching.

This change ensure no caching of the API is occurring my using an
ephemeral session when calling the tags API.
This commit is contained in:
Matt Hardcastle 2019-06-22 12:28:57 -07:00
parent 4d28c5fe41
commit 4f6e2c85f9

View file

@ -23,8 +23,8 @@
[request setHTTPMethod:@"GET"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSURLSession* session = [NSURLSession sharedSession];
// We're using an ephermeral session here to ensure the tags api response is never cached.
NSURLSession * session = [NSURLSession sessionWithConfiguration:NSURLSessionConfiguration.ephemeralSessionConfiguration];
NSURLSessionDataTask* dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {