Browse Source

Improve HTTPServer

Stan 1 ngày trước cách đây
mục cha
commit
a3eb28aaa8
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  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)