From 2fd2ad6d42f66efc6565231d08b29bdf92f257d8 Mon Sep 17 00:00:00 2001 From: Jay Baird Date: Thu, 10 Sep 2009 13:24:39 -0700 Subject: [PATCH] remove cases where intern is used. This will prevent a DoS via memory starvation if a lot of requests are sent using random headers --- tornado/httpserver.py | 2 +- tornado/wsgi.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tornado/httpserver.py b/tornado/httpserver.py index 0f1d8e00..6c85ff38 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 714b08ed..15af00f7 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("-")])