returnconfigs,fmt.Errorf(`Invalid extension %v. Should start with "."`,e)
}
extFilter.Exts.Add(e)
}
case"not":
paths:=c.RemainingArgs()
iflen(paths)==0{
returnconfigs,c.ArgErr()
}
for_,p:=rangepaths{
if!strings.HasPrefix(p,"/"){
returnconfigs,fmt.Errorf(`Invalid path %v. Should start with "/"`,p)
}
pathFilter.IgnoredPaths.Add(p)
// Warn user if / is used
ifp=="/"{
fmt.Println("Warning: Paths ignored by gzip includes wildcard(/). No request will be gzipped.\nRemoving gzip directive from Caddyfile is preferred if this is intended.")
}
}
case"level":
if!c.NextArg(){
returnconfigs,c.ArgErr()
}
level,_:=strconv.Atoi(c.Val())
config.Level=level
default:
returnconfigs,c.ArgErr()
}
}
// put pathFilter in front to filter with path first