mirror of
https://github.com/m13253/dns-over-https.git
synced 2026-03-31 22:45:40 +00:00
Turn requests lower case (to get rid of knot-resolver's mixed case)
This commit is contained in:
@@ -28,6 +28,7 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
"github.com/miekg/dns"
|
||||
"../json-dns"
|
||||
@@ -129,7 +130,7 @@ func (c *Client) handlerFunc(w dns.ResponseWriter, r *dns.Msg, isTCP bool) {
|
||||
return
|
||||
}
|
||||
question := r.Question[0]
|
||||
questionName := question.Name
|
||||
questionName := strings.ToLower(question.Name)
|
||||
questionType := ""
|
||||
if qtype, ok := dns.TypeToString[question.Qtype]; ok {
|
||||
questionType = qtype
|
||||
|
||||
@@ -87,6 +87,7 @@ func (s *Server) handlerFunc(w http.ResponseWriter, r *http.Request) {
|
||||
jsonDNS.FormatError(w, "Invalid argument value: \"name\"", 400)
|
||||
return
|
||||
}
|
||||
name = strings.ToLower(name)
|
||||
if punycode, err := idna.ToASCII(name); err == nil {
|
||||
name = punycode
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user