mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-05-03 16:52:40 +02:00
rename RemoteHosts to AllowHosts
This is what I probably should have called this when I renamed it back
in 70276f36, since this makes it more obvious that it's a list of
allowed hosts. Renaming now to make room for a `DenyHosts` variable as
part of #85.
This commit is contained in:
parent
4acc0b24ce
commit
5eab3024c6
3 changed files with 37 additions and 37 deletions
|
|
@ -42,8 +42,8 @@ import (
|
|||
const defaultMemorySize = 100
|
||||
|
||||
var addr = flag.String("addr", "localhost:8080", "TCP address to listen on")
|
||||
var remoteHosts = flag.String("remoteHosts", "", "comma separated list of allowed remote hosts")
|
||||
var whitelist = flag.String("whitelist", "", "deprecated. use 'remoteHosts' instead")
|
||||
var allowHosts = flag.String("allowHosts", "", "comma separated list of allowed remote hosts")
|
||||
var whitelist = flag.String("whitelist", "", "deprecated. use 'allowHosts' 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
|
||||
|
|
@ -61,14 +61,14 @@ func init() {
|
|||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
if *remoteHosts == "" {
|
||||
if *allowHosts == "" {
|
||||
// backwards compatible with old naming of the flag
|
||||
*remoteHosts = *whitelist
|
||||
*allowHosts = *whitelist
|
||||
}
|
||||
|
||||
p := imageproxy.NewProxy(nil, cache.Cache)
|
||||
if *remoteHosts != "" {
|
||||
p.RemoteHosts = strings.Split(*remoteHosts, ",")
|
||||
if *allowHosts != "" {
|
||||
p.AllowHosts = strings.Split(*allowHosts, ",")
|
||||
}
|
||||
if *referrers != "" {
|
||||
p.Referrers = strings.Split(*referrers, ",")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue