Browse files

Fix bug in the date strings that the unit test creates.

Per [RFC 2616, section 3.3.1](

> All HTTP date/time stamps MUST be represented in Greenwich Mean Time (GMT), without exception.

Prior to this commit, the dates being created were in the systems local timezone.
  • Loading branch information...
1 parent 1adb84f commit bae505f01f081db9fa6bb494a9daf626d84bf0e3 @johnezang johnezang committed Dec 24, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 SDURLCacheTests.m
@@ -37,6 +37,7 @@ - (void)testHttpDateParser
- (void)testExpirationDateFromHeader
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
+ [dateFormatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"GMT"]];
[dateFormatter setDateFormat:@"EEE, dd MMM yyyy HH:mm:ss z"];
NSDate *now = [NSDate date];
NSString *pastDate = [dateFormatter stringFromDate:[NSDate dateWithTimeInterval:-1000 sinceDate:now]];

0 comments on commit bae505f

Please sign in to comment.