mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 06:49:40 +02:00
Disable CSRF protection (#313)
This commit is contained in:
parent
eabf1f10e4
commit
f0e194f63b
2 changed files with 13 additions and 9 deletions
|
@ -17,7 +17,6 @@ func (a *api) newHandler(settings *Settings) http.Handler {
|
|||
)
|
||||
|
||||
handler := a.newAPIHandler()
|
||||
CSRFHandler := newCSRFHandler(a.dataPath)
|
||||
|
||||
mux.Handle("/", fileHandler)
|
||||
mux.Handle("/dockerapi/", http.StripPrefix("/dockerapi", handler))
|
||||
|
@ -28,7 +27,12 @@ func (a *api) newHandler(settings *Settings) http.Handler {
|
|||
mux.HandleFunc("/templates", func(w http.ResponseWriter, r *http.Request) {
|
||||
templatesHandler(w, r, a.templatesURL)
|
||||
})
|
||||
return CSRFHandler(newCSRFWrapper(mux))
|
||||
// CSRF protection is disabled for the moment
|
||||
// CSRFHandler := newCSRFHandler(a.dataPath)
|
||||
// return CSRFHandler(newCSRFWrapper(mux))
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
mux.ServeHTTP(w, r)
|
||||
})
|
||||
}
|
||||
|
||||
// newAPIHandler initializes a new http.Handler based on the URL scheme
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue