Permalink
Browse files

Don't set the etag header if the handler already did it.

  • Loading branch information...
1 parent bce36a7 commit 7fda8c5d381b293d8c8b632b7dd007d8533ba9a0 Ben Darnell committed Mar 20, 2010
Showing with 2 additions and 1 deletion.
  1. +2 −1 tornado/web.py
View
@@ -469,7 +469,8 @@ def finish(self, chunk=None):
# Automatically support ETags and add the Content-Length header if
# we have not flushed any content yet.
if not self._headers_written:
- if self._status_code == 200 and self.request.method == "GET":
+ if (self._status_code == 200 and self.request.method == "GET" and
+ "Etag" not in self._headers):
hasher = hashlib.sha1()
for part in self._write_buffer:
hasher.update(part)

0 comments on commit 7fda8c5

Please sign in to comment.