feat(s3) HeadObject: honor If-Modified-Since header

This commit is contained in:
Simon-Pierre Gingras 2017-05-19 15:59:25 -07:00
commit 517416c4d9
3 changed files with 46 additions and 2 deletions

View file

@ -174,11 +174,17 @@ def iso_8601_datetime_without_milliseconds(datetime):
return datetime.strftime("%Y-%m-%dT%H:%M:%S") + 'Z'
RFC1123 = '%a, %d %b %Y %H:%M:%S GMT'
def rfc_1123_datetime(datetime):
RFC1123 = '%a, %d %b %Y %H:%M:%S GMT'
return datetime.strftime(RFC1123)
def str_to_rfc_1123_datetime(str):
return datetime.datetime.strptime(str, RFC1123)
def unix_time(dt=None):
dt = dt or datetime.datetime.utcnow()
epoch = datetime.datetime.utcfromtimestamp(0)