Do not use local resolvers when given resolver input

This commit is contained in:
Karel 2023-11-27 16:37:06 +01:00
parent 78179ca7b1
commit f3a6eadfce

View File

@ -43,7 +43,13 @@ type HTTPX struct {
func New(options *Options) (*HTTPX, error) {
httpx := &HTTPX{}
fastdialerOpts := fastdialer.DefaultOptions
fastdialerOpts.EnableFallback = true
// HTTPX should only rely on system resolvers if resolvers are not explicitly specified.
if len(options.Resolvers) != 0 {
fastdialerOpts.ResolversFile = false
fastdialerOpts.EnableFallback = false
}
fastdialerOpts.Deny = options.Deny
fastdialerOpts.Allow = options.Allow
fastdialerOpts.WithDialerHistory = true