Explorar o código

Improve HTTPServer

Stan hai 1 día
pai
achega
a3eb28aaa8
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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)