doh-server: change to google.go

Allow the "cd" parameter to be case insensitive to work with some clients that send True/False instead of true/false such as gDNS.
This commit is contained in:
Chris Hills
2018-10-31 23:40:33 +00:00
committed by GitHub
parent 3b112b946e
commit 4d742bd15e

View File

@@ -71,9 +71,9 @@ func (s *Server) parseRequestGoogle(w http.ResponseWriter, r *http.Request) *DNS
cdStr := r.FormValue("cd")
cd := false
if cdStr == "1" || cdStr == "true" {
if cdStr == "1" || strings.ToUpper(cdStr) == "TRUE" {
cd = true
} else if cdStr == "0" || cdStr == "false" || cdStr == "" {
} else if cdStr == "0" || strings.ToUpper(cdStr) == "FALSE" || cdStr == "" {
} else {
return &DNSRequest{
errcode: 400,