summaryrefslogtreecommitdiff
path: root/common/foundation_request.mm
diff options
context:
space:
mode:
Diffstat (limited to 'common/foundation_request.mm')
-rw-r--r--common/foundation_request.mm4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/foundation_request.mm b/common/foundation_request.mm
index b7eafdb96c..478dadf4d9 100644
--- a/common/foundation_request.mm
+++ b/common/foundation_request.mm
@@ -91,8 +91,12 @@ mbgl::platform::request_http(const std::string &url,
}
if (!error && [response isKindOfClass:[NSHTTPURLResponse class]]) {
+ NSDictionary *headers = [(NSHTTPURLResponse *)response allHeaderFields];
(*req_ptr)->res->code = [(NSHTTPURLResponse *)response statusCode];
(*req_ptr)->res->body = {(const char *)[data bytes], [data length]};
+ (*req_ptr)->res->setCacheControl([[headers objectForKey:@"Cache-Control"] UTF8String]);
+ (*req_ptr)->res->setLastModified([[headers objectForKey:@"Last-Modified"] UTF8String]);
+
} else {
(*req_ptr)->res->error_message = [[error localizedDescription] UTF8String];
}