mirror of
https://github.com/coredns/coredns.git
synced 2026-10-08 19:45:21 -04:00
plugin/forward ensure forward sets the DOH host (#8470)
* ensure forward sets the DOH host Signed-off-by: ccie57654 <ccie57654@proton.me> * added DoHHost value test Signed-off-by: ccie57654 <ccie57654@proton.me> --------- Signed-off-by: ccie57654 <ccie57654@proton.me>
This commit is contained in:
@@ -242,7 +242,8 @@ func parseStanza(c *caddy.Controller) (*Forward, error) {
|
||||
}
|
||||
|
||||
// Only set this for proxies that need it.
|
||||
if transports[i] == transport.TLS || transports[i] == transport.QUIC {
|
||||
if transports[i] == transport.TLS || transports[i] == transport.HTTPS || transports[i] == transport.QUIC {
|
||||
f.proxies[i].SetDOHHost(f.tlsConfig.ServerName)
|
||||
if tlsConfig, ok := perServerNameTlsConfig[tlsServerNames[i]]; ok {
|
||||
f.proxies[i].SetTLSConfig(tlsConfig)
|
||||
} else {
|
||||
|
||||
@@ -960,8 +960,17 @@ func TestSetupDOHHealthcheckTLSConfig(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
got := fs[0].
|
||||
proxies[0].
|
||||
p := fs[0].proxies[0]
|
||||
|
||||
if gothost := p.DoHHost(); gothost != "dns.example" {
|
||||
t.Fatalf(
|
||||
"Expected dohHost %q, got %q",
|
||||
"dns.example",
|
||||
gothost,
|
||||
)
|
||||
}
|
||||
|
||||
got := p.
|
||||
GetHealthchecker().
|
||||
GetTLSConfig()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user