diff options
author | Marcel Hellkamp <marc@gsites.de> | 2017-11-06 13:30:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-06 13:30:02 +0100 |
commit | 58ebf2318817893b6bd48429a9edb75bdd2e82b3 (patch) | |
tree | b3b27df9f4b2577d74cdd6fea22039d2f9d6e229 | |
parent | db8da3a6aab1142ea0694963eb9afb5026c3c467 (diff) | |
parent | 443491630426c79befcc19f3c3bb4e654a6a25e5 (diff) | |
download | bottle-58ebf2318817893b6bd48429a9edb75bdd2e82b3.tar.gz |
Merge pull request #1009 from atalax/master
Fix Last-Modifed and Date header formats in static_file for non-engliā¦
-rwxr-xr-x | bottle.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2884,9 +2884,9 @@ def static_file(filename, root, stats = os.stat(filename) headers['Content-Length'] = clen = stats.st_size - lm = time.strftime("%a, %d %b %Y %H:%M:%S GMT", time.gmtime(stats.st_mtime)) - headers['Last-Modified'] = lm - headers['Date'] = time.strftime("%a, %d %b %Y %H:%M:%S GMT", time.gmtime()) + headers['Last-Modified'] = email.utils.formatdate(stats.st_mtime, + usegmt=True) + headers['Date'] = email.utils.formatdate(time.time(), usegmt=True) getenv = request.environ.get |