Skip to content

Commit

Permalink
Fix http json rpc request body not closed
Browse files Browse the repository at this point in the history
Signed-off-by: Yilun <[email protected]>
  • Loading branch information
yilunzhang committed Apr 18, 2021
1 parent b225c50 commit 7966f01
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions api/httpjson/RPCserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func (s *RPCServer) Handle(w http.ResponseWriter, r *http.Request) {
w.Header().Set("content-type", "application/json;charset=utf-8")
w.Header().Set("Access-Control-Allow-Origin", "*")
if r.Method == "POST" {
defer r.Body.Close()
// read the body of the request
body, err := ioutil.ReadAll(r.Body)
if err != nil {
Expand Down

0 comments on commit 7966f01

Please sign in to comment.