From cb78b9b696cc84d443f391a8506ba1ecc207ffb1 Mon Sep 17 00:00:00 2001 From: Star Brilliant Date: Sat, 24 Mar 2018 17:33:50 +0800 Subject: [PATCH] A DNS API server SHOULD respond with HTTP status code 415 (Unsupported Media Type) upon receiving a media type it is unable to process. --- doh-server/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doh-server/server.go b/doh-server/server.go index 7240671..6446b27 100644 --- a/doh-server/server.go +++ b/doh-server/server.go @@ -127,7 +127,7 @@ func (s *Server) handlerFunc(w http.ResponseWriter, r *http.Request) { } else if contentType == "application/dns-udpwireformat" { req = s.parseRequestIETF(w, r) } else { - jsonDNS.FormatError(w, fmt.Sprintf("Invalid argument value: \"ct\" = %q", contentType), 400) + jsonDNS.FormatError(w, fmt.Sprintf("Invalid argument value: \"ct\" = %q", contentType), 415) return } if req.errcode != 0 {