From adfc9a07d407a9e29bcd7d8af4f24bf7d75c9fe6 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Thu, 10 Mar 2016 09:14:01 -0500 Subject: refactor redirect --- src/guff/handlers/test.cr | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/guff/handlers') diff --git a/src/guff/handlers/test.cr b/src/guff/handlers/test.cr index f3ba35c..f87800e 100644 --- a/src/guff/handlers/test.cr +++ b/src/guff/handlers/test.cr @@ -29,7 +29,7 @@ class Guff::Handlers::TestHandler < Guff::Handler tags: ["_blog"] + (params["tags"] || "").to_s.split(" "), ) - redirect(context) + redirect(context, "/test") end private def set_state(context) @@ -40,11 +40,6 @@ class Guff::Handlers::TestHandler < Guff::Handler state: params["state"].to_s, ) - redirect(context) - end - - private def redirect(context) - context.response.status_code = 302 - context.response.headers["location"] = "/test" + redirect(context, "/test") end end -- cgit v1.2.3