Merge remote-tracking branch 'lerks/master' into work
This commit is contained in:
commit
76dd88f1bc
|
@ -1519,6 +1519,11 @@ class StaticFileHandler(RequestHandler):
|
||||||
return
|
return
|
||||||
|
|
||||||
if not include_body:
|
if not include_body:
|
||||||
|
self.set_header("Content-Length", os.path.getsize(abspath))
|
||||||
|
with open(abspath, "rb") as file:
|
||||||
|
hasher = hashlib.sha1()
|
||||||
|
hasher.update(file.read())
|
||||||
|
self.set_header("Etag", '"%s"' % hasher.hexdigest())
|
||||||
return
|
return
|
||||||
file = open(abspath, "rb")
|
file = open(abspath, "rb")
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue