Don't manually set Content-Length in StaticFileHandler.

Content-Length will be set automatically in RequestHandler.finish.  This
change fixes a bug in which RequestHandler.finish's Etag support strips
the response body without changing any headers.  Transfer headers
(including Content-Length and Transfer-Encoding) are the responsibility
of the framework, not the "application-level" handlers (which includes
StaticFileHandler).

Closes #160.
This commit is contained in:
Ben Darnell 2010-10-27 21:23:29 -07:00
parent 5e987aa6b2
commit b914a94ac2
1 changed files with 0 additions and 1 deletions

View File

@ -1284,7 +1284,6 @@ class StaticFileHandler(RequestHandler):
if not include_body:
return
self.set_header("Content-Length", stat_result[stat.ST_SIZE])
file = open(abspath, "rb")
try:
self.write(file.read())