소스 검색

Improve HTTPServer

Stan 1 일 전
부모
커밋
a3eb28aaa8
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      http_server.go

+ 2 - 2
http_server.go

@@ -145,7 +145,7 @@ func (this *HTTPServer) ServeHTTP(responseStream http.ResponseWriter, requestStr
 			return
 		}
 
-		err = json.Unmarshal(buffer, handler.Data)
+		err = json.Unmarshal(buffer, &handler.Data)
 		if err != nil {
 			this.log.Error("malformed request body", LogValue("path", requestStream.URL.Path), LogError(err))
 			responseStream.WriteHeader(http.StatusInternalServerError)
@@ -168,7 +168,7 @@ func (this *HTTPServer) ServeHTTP(responseStream http.ResponseWriter, requestStr
 			return
 		}
 
-		err = json.Unmarshal(buffer[:n], handler.Data)
+		err = json.Unmarshal(buffer[:n], &handler.Data)
 		if err != nil {
 			this.log.Error("malformed request body", LogValue("path", requestStream.URL.Path), LogError(err))
 			responseStream.WriteHeader(http.StatusInternalServerError)