1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-01 20:05:23 +02:00

refactor(global): remove useless code related to CSRF (#387)

This commit is contained in:
Anthony Lapenna 2016-12-16 14:00:57 +13:00 committed by GitHub
parent 5b16deb73e
commit d9f6124609
3 changed files with 1 additions and 61 deletions

View file

@ -10,7 +10,7 @@ import (
"os"
)
// newHandler creates a new http.Handler with CSRF protection
// newHandler creates a new http.Handler
func (a *api) newHandler(settings *Settings) http.Handler {
var (
mux = mux.NewRouter()
@ -37,14 +37,9 @@ func (a *api) newHandler(settings *Settings) http.Handler {
mux.HandleFunc("/templates", func(w http.ResponseWriter, r *http.Request) {
templatesHandler(w, r, a.templatesURL)
})
// mux.PathPrefix("/dockerapi/").Handler(http.StripPrefix("/dockerapi", handler))
mux.PathPrefix("/dockerapi/").Handler(http.StripPrefix("/dockerapi", addMiddleware(handler, a.authenticate, secureHeaders)))
mux.PathPrefix("/").Handler(http.StripPrefix("/", fileHandler))
// 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)
})