Update google.go

Make "cd" check case-insensitive.
This commit is contained in:
Chris Hills 2018-11-01 20:12:28 +00:00 committed by GitHub
parent 4d742bd15e
commit ef2c6bbdc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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" || strings.ToUpper(cdStr) == "TRUE" {
if cdStr == "1" || strings.EqualFold(cdStr, "true") {
cd = true
} else if cdStr == "0" || strings.ToUpper(cdStr) == "FALSE" || cdStr == "" {
} else if cdStr == "0" || strings.EqualFold(cdStr, "false") || cdStr == "" {
} else {
return &DNSRequest{
errcode: 400,