From f54b49c090dd38a171a8532999cb8c3794ecde14 Mon Sep 17 00:00:00 2001 From: Star Brilliant Date: Mon, 2 Jul 2018 13:48:05 +0800 Subject: [PATCH] Disable preventing capitalization scrambling --- doh-client/google.go | 3 +-- doh-client/ietf.go | 3 +-- doh-server/google.go | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/doh-client/google.go b/doh-client/google.go index a6cb5c5..c5fdcf8 100644 --- a/doh-client/google.go +++ b/doh-client/google.go @@ -51,8 +51,7 @@ func (c *Client) generateRequestGoogle(w dns.ResponseWriter, r *dns.Msg, isTCP b } } question := &r.Question[0] - // knot-resolver scrambles capitalization, I think it is unfriendly to cache - questionName := strings.ToLower(question.Name) + questionName := question.Name questionType := "" if qtype, ok := dns.TypeToString[question.Qtype]; ok { questionType = qtype diff --git a/doh-client/ietf.go b/doh-client/ietf.go index 6aae281..0117e72 100644 --- a/doh-client/ietf.go +++ b/doh-client/ietf.go @@ -53,8 +53,7 @@ func (c *Client) generateRequestIETF(w dns.ResponseWriter, r *dns.Msg, isTCP boo } question := &r.Question[0] - // knot-resolver scrambles capitalization, I think it is unfriendly to cache - questionName := strings.ToLower(question.Name) + questionName := question.Name questionType := "" if qtype, ok := dns.TypeToString[question.Qtype]; ok { questionType = qtype diff --git a/doh-server/google.go b/doh-server/google.go index 3fbc927..c54d511 100644 --- a/doh-server/google.go +++ b/doh-server/google.go @@ -46,7 +46,6 @@ func (s *Server) parseRequestGoogle(w http.ResponseWriter, r *http.Request) *DNS errtext: "Invalid argument value: \"name\"", } } - name = strings.ToLower(name) if punycode, err := idna.ToASCII(name); err == nil { name = punycode } else {