From e7e1fbfda99c47bbe547b11c926831e523a37147 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Mon, 3 Oct 2016 06:59:08 +0000 Subject: Error page: reduce cookie size --- wqflask/wqflask/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index cf316bee..33fab84d 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -103,7 +103,7 @@ def handle_bad_request(e): # Handle random animations # Use a cookie to have one animation on refresh - animation = request.cookies.get(err_msg[:64]) + animation = request.cookies.get(err_msg[:32]) if not animation: list = [fn for fn in os.listdir("./wqflask/static/gif/error") if fn.endswith(".gif") ] animation = random.choice(list) @@ -111,7 +111,7 @@ def handle_bad_request(e): resp = make_response(render_template("error.html",message=err_msg,stack=formatted_lines,error_image=animation)) # logger.error("Set cookie %s with %s" % (err_msg, animation)) - resp.set_cookie(err_msg[:64],animation) + resp.set_cookie(err_msg[:32],animation) return resp @app.route("/") -- cgit v1.2.3