Added support for "ETag" and "If-None-Match" headers

This commit is contained in:
Pierre-Olivier Latour
2014-04-08 23:25:33 -07:00
parent c454dc4e8e
commit 6210564bfc
6 changed files with 18 additions and 7 deletions
+1
View File
@@ -126,6 +126,7 @@ static inline NSDate* _NSDateFromTimeSpec(const struct timespec* t) {
self.contentType = GCDWebServerGetMimeTypeForExtension([path pathExtension]);
self.contentLength = (range.location != NSNotFound ? range.length : (NSUInteger)info.st_size);
self.lastModifiedDate = _NSDateFromTimeSpec(&info.st_mtimespec);
self.eTag = [NSString stringWithFormat:@"%llu/%li/%li", info.st_ino, info.st_mtimespec.tv_sec, info.st_mtimespec.tv_nsec];
}
return self;
}