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 VLAN/VPN/infra
  • Loading branch information
lidel committed Jul 29, 2024
1 parent 0190b70 commit f736895
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)

Check warning on line 19 in gateway/dns.go

View check run for this annotation

Codecov / codecov/patch

gateway/dns.go#L19

Added line #L19 was not covered by tests
}

return doh.NewResolver(url, opts...)
Expand Down

0 comments on commit f736895

Please sign in to comment.