Skip to content

Commit

Permalink
Code review updates
Browse files Browse the repository at this point in the history
Added a comment
  • Loading branch information
wiseoldduck committed Jun 11, 2018
1 parent b1ae25f commit 4dca22a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Source/Classes/PINRemoteImageManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,11 @@ - (void)downloadImageWithURL:(NSURL *)url
NSArray<NSString *> *split = [trimmed componentsSeparatedByString:@"max-age="];
if ([split count] == 2)
{
// if the max-age provided is invalid (does not parse into an
// int), we wind up with 0 which will be treated as do-not-cache.
// This is the RFC defined behavior for a malformed "expires" header,
// and while I cannot find any explicit instruction of how to behave
// with a malformed "max-age" header, it seems like a reasonable approach.
maxAge = @([split[1] integerValue]);
}
}
Expand Down

0 comments on commit 4dca22a

Please sign in to comment.