Skip to content

Commit

Permalink
fix(dns): allow http:// DoH resolvers
Browse files Browse the repository at this point in the history
allows people to run own DoH resolver on the same box or within same
secure LAN
  • Loading branch information
lidel committed Jul 29, 2024
1 parent 0190b70 commit e99d6ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gateway/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand Down

0 comments on commit e99d6ba

Please sign in to comment.