diff options
Diffstat (limited to 'plugin/proxy/upstream.go')
-rw-r--r-- | plugin/proxy/upstream.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/plugin/proxy/upstream.go b/plugin/proxy/upstream.go index 151fcad60..bcb921973 100644 --- a/plugin/proxy/upstream.go +++ b/plugin/proxy/upstream.go @@ -53,6 +53,10 @@ func NewStaticUpstreams(c *caddyfile.Dispenser) ([]Upstream, error) { return upstreams, err } + if len(toHosts) > max { + return upstreams, fmt.Errorf("more than %d TOs configured: %d", max, len(toHosts)) + } + for c.NextBlock() { if err := parseBlock(c, upstream); err != nil { return upstreams, err @@ -192,3 +196,5 @@ func (u *staticUpstream) IsAllowedDomain(name string) bool { func (u *staticUpstream) Exchanger() Exchanger { return u.ex } func (u *staticUpstream) From() string { return u.from } + +const max = 15 |