Skip to content

Commit

Permalink
extract ignoreHeaders into an explicit BOOL
Browse files Browse the repository at this point in the history
  • Loading branch information
wiseoldduck committed Jun 10, 2018
1 parent c5fad07 commit b1ae25f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/Classes/PINRemoteImageManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,8 @@ - (void)downloadImageWithURL:(NSURL *)url
id alternativeRepresentation = nil;
__block NSNumber *maxAge = nil;
if (remoteImageError == nil) {
if (_isTtlCache && !(options & PINRemoteImageManagerDownloadOptionsIgnoreCacheControlHeaders)) {
BOOL ignoreHeaders = (options & PINRemoteImageManagerDownloadOptionsIgnoreCacheControlHeaders) != 0;
if (_isTtlCache && !ignoreHeaders) {
// examine Cache-Control headers (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control)
if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
Expand Down

0 comments on commit b1ae25f

Please sign in to comment.