mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
feat(csrf): add trusted origins cli flags [BE-11972] (#836)
This commit is contained in:
parent
303047656e
commit
0556ffb4a1
9 changed files with 359 additions and 9 deletions
|
@ -113,6 +113,7 @@ type Server struct {
|
|||
PendingActionsService *pendingactions.PendingActionsService
|
||||
PlatformService platform.Service
|
||||
PullLimitCheckDisabled bool
|
||||
TrustedOrigins []string
|
||||
}
|
||||
|
||||
// Start starts the HTTP server
|
||||
|
@ -336,7 +337,7 @@ func (server *Server) Start() error {
|
|||
|
||||
handler = middlewares.WithPanicLogger(middlewares.WithSlowRequestsLogger(handler))
|
||||
|
||||
handler, err := csrf.WithProtect(handler)
|
||||
handler, err := csrf.WithProtect(handler, server.TrustedOrigins)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to create CSRF middleware")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue