From 906c4e8a93658cefe8ac0679d7f2e1202c71f47b Mon Sep 17 00:00:00 2001 From: Jordan Wright Date: Sat, 3 Oct 2015 15:16:11 -0500 Subject: [PATCH] Adjusted CSRF whitelisted paths so remove dependency on / in path. Fixes #31 --- controllers/route.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/controllers/route.go b/controllers/route.go index e49c6287..645b8164 100644 --- a/controllers/route.go +++ b/controllers/route.go @@ -57,11 +57,11 @@ func CreateAdminRouter() http.Handler { // Setup CSRF Protection csrfHandler := nosurf.New(router) // Exempt API routes and Static files - csrfHandler.ExemptGlob("/api/campaigns/*") - csrfHandler.ExemptGlob("/api/groups/*") - csrfHandler.ExemptGlob("/api/templates/*") - csrfHandler.ExemptGlob("/api/pages/*") - csrfHandler.ExemptGlob("/api/import/*") + csrfHandler.ExemptGlob("/api/campaigns*") + csrfHandler.ExemptGlob("/api/groups*") + csrfHandler.ExemptGlob("/api/templates*") + csrfHandler.ExemptGlob("/api/pages*") + csrfHandler.ExemptGlob("/api/import*") csrfHandler.ExemptGlob("/static/*") return Use(csrfHandler.ServeHTTP, mid.GetContext) }