diff options
author | Wolfy-J <[email protected]> | 2018-06-13 14:07:58 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-13 14:07:58 +0300 |
commit | 7d77b05901f4b34025a307de2ac4a83ae3162452 (patch) | |
tree | 847574125797cb69d444530cbae59cf345cbe415 /service/static | |
parent | ca95f67317bcf8972b9e669869338a7dc09bf06d (diff) |
minor refactor
Diffstat (limited to 'service/static')
-rw-r--r-- | service/static/service.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/service/static/service.go b/service/static/service.go index 5f7d31f0..8d383fcf 100644 --- a/service/static/service.go +++ b/service/static/service.go @@ -42,7 +42,7 @@ func (s *Service) Init(cfg service.Config, c service.Container) (enabled bool, e // registering as middleware if h, ok := c.Get(rrttp.Name); ok >= service.StatusConfigured { if h, ok := h.(*rrttp.Service); ok { - h.AddMiddleware(s) + h.AddMiddleware(s.middleware) } } @@ -55,8 +55,8 @@ func (s *Service) Serve() error { return nil } // Stop stops the service. func (s *Service) Stop() {} -// Handle must return true if request/response pair is handled withing the middleware. -func (s *Service) Handle(w http.ResponseWriter, r *http.Request) bool { +// middleware must return true if request/response pair is handled withing the middleware. +func (s *Service) middleware(w http.ResponseWriter, r *http.Request) bool { fPath := r.URL.Path if !strings.HasPrefix(fPath, "/") { fPath = "/" + fPath @@ -78,7 +78,7 @@ func (s *Service) Handle(w http.ResponseWriter, r *http.Request) bool { return false } - // do not Handle directories + // do not middleware directories if d.IsDir() { return false } |