From 28078d9c8ef9666d92eba345507a0103b5a5531a Mon Sep 17 00:00:00 2001 From: Mrs4s Date: Wed, 22 Sep 2021 14:49:16 +0800 Subject: [PATCH] fix typo. --- server/http.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/http.go b/server/http.go index 3329376..24e780f 100644 --- a/server/http.go +++ b/server/http.go @@ -75,7 +75,7 @@ func (h *httpCtx) Get(s string) gjson.Result { func (s *httpServer) ServeHTTP(writer http.ResponseWriter, request *http.Request) { var ctx httpCtx - contentType := request.Header.Get("Content-SubType") + contentType := request.Header.Get("Content-Type") switch request.Method { case http.MethodPost: if strings.Contains(contentType, "application/json") { @@ -119,7 +119,7 @@ func (s *httpServer) ServeHTTP(writer http.ResponseWriter, request *http.Request log.Debugf("HTTPServer接收到API调用: %v", action) ret := s.api.callAPI(action, &ctx) - writer.Header().Set("Content-SubType", "application/json; charset=utf-8") + writer.Header().Set("Content-Type", "application/json; charset=utf-8") writer.WriteHeader(http.StatusOK) _ = json.NewEncoder(writer).Encode(ret) }