From: Jay Baird Date: Thu, 10 Sep 2009 20:24:39 +0000 (-0700) Subject: remove cases where intern is used. This will prevent a DoS via memory starvation... X-Git-Tag: v1.0.0~125^2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fd2ad6d42f66efc6565231d08b29bdf92f257d8;p=thirdparty%2Ftornado.git remove cases where intern is used. This will prevent a DoS via memory starvation if a lot of requests are sent using random headers --- diff --git a/tornado/httpserver.py b/tornado/httpserver.py index 0f1d8e00f..6c85ff38a 100644 --- a/tornado/httpserver.py +++ b/tornado/httpserver.py @@ -318,7 +318,7 @@ class HTTPHeaders(dict): return dict.__getitem__(self, self._normalize_name(name)) def _normalize_name(self, name): - return intern("-".join([w.capitalize() for w in name.split("-")])) + return "-".join([w.capitalize() for w in name.split("-")]) @classmethod def parse(cls, headers_string): diff --git a/tornado/wsgi.py b/tornado/wsgi.py index 714b08ed4..15af00f78 100644 --- a/tornado/wsgi.py +++ b/tornado/wsgi.py @@ -187,4 +187,4 @@ class HTTPHeaders(dict): return dict.__getitem__(self, self._normalize_name(name)) def _normalize_name(self, name): - return intern("-".join([w.capitalize() for w in name.split("-")])) + return "-".join([w.capitalize() for w in name.split("-")])