CSRF: Fix additional headers option (#50629)

* CSRF: Fix additional headers option

* fix: type assertion on error fail on wrapped error

* Update pkg/middleware/csrf/csrf_test.go

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>

* update test

Co-authored-by: eleijonmarck <eric.leijonmarck@gmail.com>
This commit is contained in:
Emil Tullstedt
2022-07-13 19:28:59 +01:00
committed by GitHub
co-authored by eleijonmarck
parent ab6cf9e94d
commit 06bd8b8e7a
3 changed files with 222 additions and 78 deletions
+1 -1
View File
@@ -519,7 +519,7 @@ func (hs *HTTPServer) addMiddlewaresAndStaticRoutes() {
}
m.Use(middleware.Recovery(hs.Cfg))
m.UseMiddleware(hs.Csrf.Middleware(hs.log))
m.UseMiddleware(hs.Csrf.Middleware())
hs.mapStatic(m, hs.Cfg.StaticRootPath, "build", "public/build")
hs.mapStatic(m, hs.Cfg.StaticRootPath, "", "public", "/public/views/swagger.html")