diff --git a/CHANGELOG.md b/CHANGELOG.md index f3f752d..e043ce8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Changed - updated docker image to use go1.12 compiler and build imageproxy as a go module. +### Removed + - removed deprecated `whitelist` flag and `Proxy.Whitelist` struct field. Use + `allowHosts` and `Proxy.AllowHosts` instead. + ## [0.8.0] (2019-03-21) ### Added diff --git a/cmd/imageproxy/main.go b/cmd/imageproxy/main.go index 3778bac..b560e87 100644 --- a/cmd/imageproxy/main.go +++ b/cmd/imageproxy/main.go @@ -43,7 +43,6 @@ const defaultMemorySize = 100 var addr = flag.String("addr", "localhost:8080", "TCP address to listen on") var allowHosts = flag.String("allowHosts", "", "comma separated list of allowed remote hosts") -var whitelist = flag.String("whitelist", "", "deprecated. use 'allowHosts' instead") var denyHosts = flag.String("denyHosts", "", "comma separated list of denied remote hosts") var referrers = flag.String("referrers", "", "comma separated list of allowed referring hosts") var baseURL = flag.String("baseURL", "", "default base URL for relative remote URLs") @@ -62,10 +61,6 @@ func init() { func main() { flag.Parse() - if *allowHosts == "" { - // backwards compatible with old naming of the flag - *allowHosts = *whitelist - } p := imageproxy.NewProxy(nil, cache.Cache) if *allowHosts != "" { diff --git a/imageproxy.go b/imageproxy.go index 3c833af..292285d 100644 --- a/imageproxy.go +++ b/imageproxy.go @@ -47,9 +47,6 @@ type Proxy struct { // proxied from. An empty list means all hosts are allowed. AllowHosts []string - // Whitelist should no longer be used. Use "AllowHosts" instead. - Whitelist []string - // DenyHosts specifies a list of remote hosts that images cannot be // proxied from. DenyHosts []string @@ -229,10 +226,6 @@ var ( // referrer, host, and signature. It returns an error if the request is not // allowed. func (p *Proxy) allowed(r *Request) error { - if p.AllowHosts == nil { - // backwards compatible with old naming of the field - p.AllowHosts = p.Whitelist - } if len(p.Referrers) > 0 && !referrerMatches(p.Referrers, r.Original) { return errReferrer }