1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-06 12:03:50 +08:00

fix typo.

This commit is contained in:
Mrs4s 2021-09-22 14:49:16 +08:00
parent 66266f0d5e
commit 28078d9c8e
No known key found for this signature in database
GPG Key ID: 3186E98FA19CE3A7

View File

@ -75,7 +75,7 @@ func (h *httpCtx) Get(s string) gjson.Result {
func (s *httpServer) ServeHTTP(writer http.ResponseWriter, request *http.Request) { func (s *httpServer) ServeHTTP(writer http.ResponseWriter, request *http.Request) {
var ctx httpCtx var ctx httpCtx
contentType := request.Header.Get("Content-SubType") contentType := request.Header.Get("Content-Type")
switch request.Method { switch request.Method {
case http.MethodPost: case http.MethodPost:
if strings.Contains(contentType, "application/json") { 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) log.Debugf("HTTPServer接收到API调用: %v", action)
ret := s.api.callAPI(action, &ctx) 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) writer.WriteHeader(http.StatusOK)
_ = json.NewEncoder(writer).Encode(ret) _ = json.NewEncoder(writer).Encode(ret)
} }