From 2299cf96bb12ff1ffc26f5e6bd071fdd37fd2204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20Tis=C3=A4ter?= Date: Tue, 8 Jul 2014 09:07:48 +0200 Subject: [PATCH] Don't raise when failing to hex decode XSRF v1 --- tornado/web.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tornado/web.py b/tornado/web.py index 7147c17e..11dab74f 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -1145,7 +1145,7 @@ class RequestHandler(object): try: token = binascii.a2b_hex(utf8(cookie)) except TypeError: - raise HTTPError(400, "XSRF cookie is not a hexadecimal") + token = utf8(cookie) # We don't have a usable timestamp in older versions. timestamp = int(time.time()) return (version, token, timestamp)