♻️ compression: avoid magic numbers in compression level check

Avoid the magic numbers to make it easier to read
This commit is contained in:
Roman 2020-10-07 09:56:27 +02:00
parent e090f5278a
commit 6e72025b6c

View File

@ -46,7 +46,7 @@ func New(config ...Config) fiber.Handler {
cfg = config[0]
// Set default values
if cfg.Level < -1 || cfg.Level > 2 {
if cfg.Level < LevelDisabled || cfg.Level > LevelBestCompression {
cfg.Level = ConfigDefault.Level
}
}