Procházet zdrojové kódy

Improve HTTPServer

Stan před 1 dnem
rodič
revize
a3eb28aaa8
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  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)