From 9f292777bf7d0bce2f3c26a809c52c54d859930f Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Thu, 7 Feb 2019 20:53:55 -0700 Subject: [PATCH] Add ability to disable proxy hostname check --- pkg/proxy/util/utils.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/proxy/util/utils.go b/pkg/proxy/util/utils.go index 2c1408da43..9c776cf495 100644 --- a/pkg/proxy/util/utils.go +++ b/pkg/proxy/util/utils.go @@ -40,6 +40,7 @@ const ( var ( ErrAddressNotAllowed = errors.New("address not allowed") ErrNoAddresses = errors.New("No addresses for hostname") + DisableProxyHostnameCheck = false ) func IsZeroCIDR(cidr string) bool { @@ -72,6 +73,10 @@ type Resolver interface { // IsProxyableHostname checks if the IP addresses for a given hostname are permitted to be proxied func IsProxyableHostname(ctx context.Context, resolv Resolver, hostname string) error { + if DisableProxyHostnameCheck { + return nil + } + resp, err := resolv.LookupIPAddr(ctx, hostname) if err != nil { return err