From 4fc045de115ffb3a5c52cd55c369842880386943 Mon Sep 17 00:00:00 2001 From: Ainar Garipov Date: Tue, 20 Sep 2022 15:26:10 +0300 Subject: [PATCH] Pull request: 4927-ddr-template Updates #4927. Squashed commit of the following: commit 8cf080d5355261ced7e8b10de607cbf37e1d663d Author: Ainar Garipov Date: Tue Sep 20 15:18:48 2022 +0300 dnsforward: fix doh template --- CHANGELOG.md | 5 +++++ internal/dnsforward/dns.go | 2 +- internal/dnsforward/dns_test.go | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c9ccdcf..dfeae3b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,12 @@ and this project adheres to - Support for plain (unencrypted) HTTP/2 ([#4930]). This is useful for AdGuard Home installations behind a reverse proxy. +### Fixed + +- Incorrect path template in DDR responses ([#4927]). + [#2993]: https://github.com/AdguardTeam/AdGuardHome/issues/2993 +[#4927]: https://github.com/AdguardTeam/AdGuardHome/issues/4927 [#4930]: https://github.com/AdguardTeam/AdGuardHome/issues/4930 diff --git a/internal/dnsforward/dns.go b/internal/dnsforward/dns.go index 3f5642e9..947625e3 100644 --- a/internal/dnsforward/dns.go +++ b/internal/dnsforward/dns.go @@ -296,7 +296,7 @@ func (s *Server) makeDDRResponse(req *dns.Msg) (resp *dns.Msg) { values := []dns.SVCBKeyValue{ &dns.SVCBAlpn{Alpn: []string{"h2"}}, &dns.SVCBPort{Port: uint16(addr.Port)}, - &dns.SVCBDoHPath{Template: "/dns-query?dns"}, + &dns.SVCBDoHPath{Template: "/dns-query{?dns}"}, } ans := &dns.SVCB{ diff --git a/internal/dnsforward/dns_test.go b/internal/dnsforward/dns_test.go index ebdc716c..da7c8ae6 100644 --- a/internal/dnsforward/dns_test.go +++ b/internal/dnsforward/dns_test.go @@ -26,7 +26,7 @@ func TestServer_ProcessDDRQuery(t *testing.T) { Value: []dns.SVCBKeyValue{ &dns.SVCBAlpn{Alpn: []string{"h2"}}, &dns.SVCBPort{Port: 8044}, - &dns.SVCBDoHPath{Template: "/dns-query?dns"}, + &dns.SVCBDoHPath{Template: "/dns-query{?dns}"}, }, }