Skip to content

Commit

Permalink
Rebase from master
Browse files Browse the repository at this point in the history
  • Loading branch information
thomiceli committed Jan 20, 2025
1 parent 062a1d6 commit 3b0a175
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Empty file removed internal/web/server.go
Empty file.
5 changes: 5 additions & 0 deletions internal/web/server/middlewares.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ func (s *Server) registerMiddlewares() {
CookiePath: "/",
CookieHTTPOnly: true,
CookieSameSite: http.SameSiteStrictMode,
Skipper: func(ctx echo.Context) bool {
/* skip CSRF for embeds */
gistName := ctx.Param("gistname")
return filepath.Ext(gistName) == ".js"
},
}))
s.echo.Use(Middleware(csrfInit).toEcho())
}
Expand Down

0 comments on commit 3b0a175

Please sign in to comment.