fix: prefix match in DNS https (#1573)

Signed-off-by: Cherrling <me@cherr.cc>
This commit is contained in:
白日梦主义 2026-05-16 07:37:19 +08:00 committed by GitHub
parent d34dc40eff
commit 6dc0f3f792
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20,7 +20,7 @@ type dohResolver struct {
func NewDoHResolver(addr string, timeout time.Duration, sni string, insecure bool, next PluggableOutbound) PluggableOutbound {
// User may provide just the IP address or full URL
if !strings.HasSuffix(addr, "https://") {
if !strings.HasPrefix(addr, "https://") {
addr = fmt.Sprintf("https://%s/dns-query", addr)
}
tr := http.DefaultTransport.(*http.Transport).Clone()