From: Luca Wehrstedt Date: Sat, 29 Oct 2011 22:15:19 +0000 (+0300) Subject: Add Content-Length header on HEAD requests for StaticFileHandler. X-Git-Tag: v2.2.0~14^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60b3e66232ec6b2021dbc68b1ef42f8443162c68;p=thirdparty%2Ftornado.git Add Content-Length header on HEAD requests for StaticFileHandler. --- diff --git a/tornado/web.py b/tornado/web.py index e87f33054..78267b3ae 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -1484,6 +1484,7 @@ class StaticFileHandler(RequestHandler): return if not include_body: + self.set_header("Content-Length", os.path.getsize(abspath)) return file = open(abspath, "rb") try: