Adjusted CSRF whitelisted paths so remove dependency on / in path.

Fixes #31
This commit is contained in:
Jordan Wright 2015-10-03 15:16:11 -05:00
parent b4a73ae5c7
commit 906c4e8a93

View file

@ -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)
}