The cap is too low for some uses, and it's unclear if it's worth
keeping.
Closes #1473.
Closes #1025.
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