Commit 8d1cc84a authored by Darren Shepherd's avatar Darren Shepherd

Add ability to disable proxy hostname check

parent 5b74f5c8
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment