diff --git a/doh-client/google.go b/doh-client/google.go index d985e8a..e1c2241 100644 --- a/doh-client/google.go +++ b/doh-client/google.go @@ -48,7 +48,7 @@ func (c *Client) handlerFuncGoogle(w dns.ResponseWriter, r *dns.Msg, isTCP bool) w.WriteMsg(reply) return } - question := r.Question[0] + question := &r.Question[0] // knot-resolver scrambles capitalization, I think it is unfriendly to cache questionName := strings.ToLower(question.Name) questionType := "" diff --git a/doh-client/ietf.go b/doh-client/ietf.go index 33b69b7..c78f745 100644 --- a/doh-client/ietf.go +++ b/doh-client/ietf.go @@ -49,7 +49,7 @@ func (c *Client) handlerFuncIETF(w dns.ResponseWriter, r *dns.Msg, isTCP bool) { return } - question := r.Question[0] + question := &r.Question[0] // knot-resolver scrambles capitalization, I think it is unfriendly to cache questionName := strings.ToLower(question.Name) questionType := "" diff --git a/doh-server/ietf.go b/doh-server/ietf.go index 2bede2d..fec2c6f 100644 --- a/doh-server/ietf.go +++ b/doh-server/ietf.go @@ -70,7 +70,7 @@ func (s *Server) parseRequestIETF(w http.ResponseWriter, r *http.Request) *DNSRe } if s.conf.Verbose && len(msg.Question) > 0 { - question := msg.Question[0] + question := &msg.Question[0] questionName := question.Name questionClass := "" if qclass, ok := dns.ClassToString[question.Qclass]; ok {