]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Don't set the etag header if the handler already did it.
authorBen Darnell <bdarnell@beaker.local>
Sat, 20 Mar 2010 19:20:42 +0000 (12:20 -0700)
committerBen Darnell <bdarnell@beaker.local>
Sat, 20 Mar 2010 19:20:42 +0000 (12:20 -0700)
tornado/web.py

index 766a441ffe90b9584a3044c543ba0f43a8e4b89d..f1ee8ee57da40c7d02c2a4b5884f379d48c1daa7 100644 (file)
@@ -469,7 +469,8 @@ class RequestHandler(object):
         # 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)