diff options
Diffstat (limited to 'plugins/http/plugin.go')
-rw-r--r-- | plugins/http/plugin.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/http/plugin.go b/plugins/http/plugin.go index 371cdb91..a6399489 100644 --- a/plugins/http/plugin.go +++ b/plugins/http/plugin.go @@ -183,6 +183,11 @@ func (s *Plugin) Serve() chan error { s.fcgi = &http.Server{Handler: s} } + // apply middlewares before starting the server + if len(s.mdwr) > 0 { + s.addMiddlewares() + } + if s.http != nil { go func() { httpErr := s.http.ListenAndServe() @@ -217,10 +222,6 @@ func (s *Plugin) Serve() chan error { }() } - if len(s.mdwr) > 0 { - s.addMiddlewares() - } - return errCh } |