From 95c4dce40f089b8160d60af58383b32bf67275a0 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Wed, 29 Jul 2015 22:53:33 -0400 Subject: [PATCH] Remove arbitrary cap on length of outgoing headers. The cap is too low for some uses, and it's unclear if it's worth keeping. Closes #1473. Closes #1025. --- tornado/web.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tornado/web.py b/tornado/web.py index 4ff75771b..f237d78f0 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -362,10 +362,8 @@ class RequestHandler(object): else: raise TypeError("Unsupported header value %r" % value) # If \n is allowed into the header, it is possible to inject - # additional headers or split the request. Also cap length to - # prevent obviously erroneous values. - if (len(value) > 4000 or - RequestHandler._INVALID_HEADER_CHAR_RE.search(value)): + # additional headers or split the request. + if RequestHandler._INVALID_HEADER_CHAR_RE.search(value): raise ValueError("Unsafe header value %r", value) return value -- 2.47.2