summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.rst7
-rw-r--r--cherrypy/_cprequest.py5
2 files changed, 9 insertions, 3 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index 136623ce..a9ca819e 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,3 +1,10 @@
+v12.0.2
+-------
+
+* #1665: In request processing, when an invalid cookie is
+ received, render the actual error message reported rather
+ than guessing (sometimes incorrectly) what error occurred.
+
v12.0.1
-------
diff --git a/cherrypy/_cprequest.py b/cherrypy/_cprequest.py
index ed404d7b..ddff3669 100644
--- a/cherrypy/_cprequest.py
+++ b/cherrypy/_cprequest.py
@@ -731,9 +731,8 @@ class Request(object):
if name == 'Cookie':
try:
self.cookie.load(value)
- except CookieError:
- msg = 'Illegal cookie name %s' % value.split('=')[0]
- raise cherrypy.HTTPError(400, msg)
+ except CookieError as exc:
+ raise cherrypy.HTTPError(400, str(exc))
if not dict.__contains__(headers, 'Host'):
# All Internet-based HTTP/1.1 servers MUST respond with a 400