From 4eaa46ff453111a4f2de8aba99882aa9b6a3696e Mon Sep 17 00:00:00 2001 From: dingjun Date: Tue, 30 Jun 2020 19:25:47 +0800 Subject: [PATCH] not check content-type --- server_https.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/server_https.go b/server_https.go index 3f22eaa..abd24a7 100644 --- a/server_https.go +++ b/server_https.go @@ -3,7 +3,6 @@ package main import ( "io/ioutil" "net/http" - "strings" "github.com/fangdingjun/go-log" "github.com/miekg/dns" @@ -12,12 +11,14 @@ import ( const dnsMsgType = "application/dns-message" func (srv *server) handleHTTPReq(w http.ResponseWriter, r *http.Request) { - ctype := r.Header.Get("content-type") - if !strings.HasPrefix(ctype, dnsMsgType) { - log.Errorf("request type %s, require %s", ctype, dnsMsgType) - http.Error(w, "dns message is required", http.StatusBadRequest) - return - } + /* + ctype := r.Header.Get("content-type") + if !strings.HasPrefix(ctype, dnsMsgType) { + log.Errorf("request type %s, require %s", ctype, dnsMsgType) + http.Error(w, "dns message is required", http.StatusBadRequest) + return + } + */ if r.ContentLength < 10 { log.Errorf("message is too small, %v", r.ContentLength)