diff options
author | Valery Piashchynski <[email protected]> | 2021-04-28 14:10:27 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-04-28 14:10:27 +0300 |
commit | 30c25f17fa7d6386e33a4894c812f7ca5db990ad (patch) | |
tree | 03f53535addf71a81eca4b9a1d3ba29d4ebf4984 /plugins/headers/plugin.go | |
parent | 4cb2247f909d02c922edb6f8e3d3741cc5a2c077 (diff) |
- Fix middleware order
- Update tests
- Move worker handler into a separate folder with separate package name
Signed-off-by: Valery Piashchynski <[email protected]>
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 { |