Permalink
Browse files

Override dict.copy in HTTPHeaders to return the correct type.

Closes #519.
  • Loading branch information...
1 parent e101397 commit f41306da0fc7cc07b45e685bb28f57448df3c332 @bdarnell bdarnell committed May 26, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 tornado/httputil.py
View
@@ -154,6 +154,10 @@ def update(self, *args, **kwargs):
for k, v in dict(*args, **kwargs).iteritems():
self[k] = v
+ def copy(self):
+ # default implementation returns dict(self), not the subclass
+ return HTTPHeaders(self)
+
_NORMALIZED_HEADER_RE = re.compile(r'^[A-Z0-9][a-z0-9]*(-[A-Z0-9][a-z0-9]*)*$')
_normalized_headers = {}

0 comments on commit f41306d

Please sign in to comment.