From f73689504bdde5c63ecacaa551448f1df6c42e07 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Mon, 29 Jul 2024 23:20:27 +0200 Subject: [PATCH] fix(dns): allow http:// DoH resolvers allows people to run own DoH resolver on the same box or within same secure VLAN/VPN/infra --- gateway/dns.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gateway/dns.go b/gateway/dns.go index 376c42669..3d725ee85 100644 --- a/gateway/dns.go +++ b/gateway/dns.go @@ -15,8 +15,8 @@ var defaultResolvers = map[string]string{ } func newResolver(url string, opts ...doh.Option) (madns.BasicResolver, error) { - if !strings.HasPrefix(url, "https://") { - return nil, fmt.Errorf("invalid resolver url: %s", url) + if !strings.HasPrefix(url, "https://") && !strings.HasPrefix(url, "http://") { + return nil, fmt.Errorf("invalid DoH resolver URL: %s", url) } return doh.NewResolver(url, opts...)