From e99d6ba7b3617f4079004b2f24d944c855a53ca2 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 LAN --- gateway/dns.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gateway/dns.go b/gateway/dns.go index 376c42669..a96b4c7ca 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...)