diff options
Diffstat (limited to 'service/static/service.go')
-rw-r--r-- | service/static/service.go | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/service/static/service.go b/service/static/service.go index 98d8313c..b2723e42 100644 --- a/service/static/service.go +++ b/service/static/service.go @@ -4,7 +4,6 @@ import ( rrttp "github.com/spiral/roadrunner/service/http" "net/http" "path" - "strings" ) // ID contains default service name. @@ -22,7 +21,7 @@ type Service struct { // Init must return configure service and return true if service hasStatus enabled. Must return error in case of // misconfiguration. Services must not be used without proper configuration pushed first. func (s *Service) Init(cfg *Config, r *rrttp.Service) (bool, error) { - if !cfg.Enable || r == nil { + if r == nil { return false, nil } @@ -44,12 +43,7 @@ func (s *Service) middleware(f http.HandlerFunc) http.HandlerFunc { } func (s *Service) handleStatic(w http.ResponseWriter, r *http.Request) bool { - fPath := r.URL.Path - - if !strings.HasPrefix(fPath, "/") { - fPath = "/" + fPath - } - fPath = path.Clean(fPath) + fPath := path.Clean(r.URL.Path) if s.cfg.Forbids(fPath) { return false |