mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-05-04 01:02:40 +02:00
rename 'Whitelist' to 'RemoteHosts"
This better describes what exactly is being allowed.
This commit is contained in:
parent
0370572130
commit
70276f36bc
7 changed files with 61 additions and 49 deletions
|
|
@ -42,7 +42,8 @@ import (
|
|||
const defaultMemorySize = 100
|
||||
|
||||
var addr = flag.String("addr", "localhost:8080", "TCP address to listen on")
|
||||
var whitelist = flag.String("whitelist", "", "comma separated list of allowed remote hosts")
|
||||
var remoteHosts = flag.String("remoteHosts", "", "comma separated list of allowed remote hosts")
|
||||
var whitelist = flag.String("whitelist", "", "deprecated. use 'remoteHosts' instead")
|
||||
var referrers = flag.String("referrers", "", "comma separated list of allowed referring hosts")
|
||||
var baseURL = flag.String("baseURL", "", "default base URL for relative remote URLs")
|
||||
var cache tieredCache
|
||||
|
|
@ -59,10 +60,14 @@ func init() {
|
|||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
if *remoteHosts == "" {
|
||||
// backwards compatible with old naming of the flag
|
||||
*remoteHosts = *whitelist
|
||||
}
|
||||
|
||||
p := imageproxy.NewProxy(nil, cache.Cache)
|
||||
if *whitelist != "" {
|
||||
p.Whitelist = strings.Split(*whitelist, ",")
|
||||
if *remoteHosts != "" {
|
||||
p.RemoteHosts = strings.Split(*remoteHosts, ",")
|
||||
}
|
||||
if *referrers != "" {
|
||||
p.Referrers = strings.Split(*referrers, ",")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue