diff options
Diffstat (limited to 'plugins/headers/plugin.go')
-rw-r--r-- | plugins/headers/plugin.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/headers/plugin.go b/plugins/headers/plugin.go index a5ee702f..dea0d127 100644 --- a/plugins/headers/plugin.go +++ b/plugins/headers/plugin.go @@ -38,9 +38,9 @@ func (s *Plugin) Init(cfg config.Configurer) error { } // middleware must return true if request/response pair is handled within the middleware. -func (s *Plugin) Middleware(next http.Handler) http.HandlerFunc { +func (s *Plugin) Middleware(next http.Handler) http.Handler { // Define the http.HandlerFunc - return func(w http.ResponseWriter, r *http.Request) { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if s.cfg.Headers.Request != nil { for k, v := range s.cfg.Headers.Request { r.Header.Add(k, v) @@ -62,7 +62,7 @@ func (s *Plugin) Middleware(next http.Handler) http.HandlerFunc { } next.ServeHTTP(w, r) - } + }) } func (s *Plugin) Name() string { |