diff options
Diffstat (limited to 'service/gzip/service.go')
-rw-r--r-- | service/gzip/service.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/service/gzip/service.go b/service/gzip/service.go index 5ae3ffd5..231ba4d9 100644 --- a/service/gzip/service.go +++ b/service/gzip/service.go @@ -9,21 +9,20 @@ import ( // ID contains default service name. const ID = "gzip" -var httpNotInitialized = errors.New("http service should be defined properly in config") +var httpNotInitialized = errors.New("http service should be defined properly in config to use gzip") type Service struct { cfg *Config } func (s *Service) Init(cfg *Config, r *rrhttp.Service) (bool, error) { - if r == nil { - return false, httpNotInitialized - } s.cfg = cfg - if !s.cfg.Enable { return false, nil } + if r == nil { + return false, httpNotInitialized + } r.AddMiddleware(s.middleware) |