Skip to content

Commit 1b2472d

Browse files
committed
Fix double-bracketing of IPv6 addresses in DoH stamps
When a DoH stamp contains an IPv6 address with brackets in the ProviderName field (e.g., [2606:4700:4700::1113]), the DialContext function was adding another layer of brackets, resulting in invalid addresses like [[2606:4700:4700::1113]]:443.
1 parent 0e82c50 commit 1b2472d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

dnscrypt-proxy/xtransport.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ func (xTransport *XTransport) rebuildTransport() {
244244
return "[" + ip.String() + "]:" + strconv.Itoa(port)
245245
}
246246
if parsed := ParseIP(host); parsed != nil && parsed.To4() == nil {
247-
return "[" + host + "]:" + strconv.Itoa(port)
247+
return "[" + parsed.String() + "]:" + strconv.Itoa(port)
248248
}
249249
return host + ":" + strconv.Itoa(port)
250250
}

0 commit comments

Comments
 (0)