##// END OF EJS Templates
backport If-Modified-Since fix from tornado...
MinRK -
Show More
@@ -820,7 +820,7 b' class FileFindHandler(web.StaticFileHandler):'
820 raise HTTPError(403, "%s is not a file", path)
820 raise HTTPError(403, "%s is not a file", path)
821
821
822 stat_result = os.stat(abspath)
822 stat_result = os.stat(abspath)
823 modified = datetime.datetime.fromtimestamp(stat_result[stat.ST_MTIME])
823 modified = datetime.datetime.utcfromtimestamp(stat_result[stat.ST_MTIME])
824
824
825 self.set_header("Last-Modified", modified)
825 self.set_header("Last-Modified", modified)
826
826
@@ -844,7 +844,7 b' class FileFindHandler(web.StaticFileHandler):'
844 ims_value = self.request.headers.get("If-Modified-Since")
844 ims_value = self.request.headers.get("If-Modified-Since")
845 if ims_value is not None:
845 if ims_value is not None:
846 date_tuple = email.utils.parsedate(ims_value)
846 date_tuple = email.utils.parsedate(ims_value)
847 if_since = datetime.datetime.fromtimestamp(time.mktime(date_tuple))
847 if_since = datetime.datetime(*date_tuple[:6])
848 if if_since >= modified:
848 if if_since >= modified:
849 self.set_status(304)
849 self.set_status(304)
850 return
850 return
General Comments 0
You need to be logged in to leave comments. Login now