mirror of https://github.com/artifacthub/hub.git
Allow adding CSRF trusted origins (#4457)
Signed-off-by: Sergio Castaño Arteaga <tegioz@icloud.com>
This commit is contained in:
parent
e7d3d58337
commit
2a5e724e0c
|
|
@ -32,3 +32,5 @@ server:
|
|||
csrf:
|
||||
authKey: default-unsafe-key
|
||||
secure: false
|
||||
trustedOrigins:
|
||||
- localhost:8000
|
||||
|
|
|
|||
|
|
@ -173,6 +173,7 @@ func (h *Handlers) setupRouter() {
|
|||
csrf.Secure(h.cfg.GetBool("server.csrf.secure")),
|
||||
csrf.Path("/api/v1"),
|
||||
csrf.CookieName("csrf"),
|
||||
csrf.TrustedOrigins(h.cfg.GetStringSlice("server.csrf.trustedOrigins")),
|
||||
))
|
||||
r.Get("/csrf", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Cache-Control", "no-store")
|
||||
|
|
|
|||
Loading…
Reference in New Issue