Browse Source

fix `RecoverAndLogHandler` not to call multiple writeheader (#2688)

pull/2694/head
Jun Kimura 6 years ago
committed by Anton Kaliaev
parent
commit
9795e12ef2
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      rpc/lib/server/http_server.go

+ 1
- 2
rpc/lib/server/http_server.go View File

@ -173,8 +173,7 @@ func RecoverAndLogHandler(handler http.Handler, logger log.Logger) http.Handler
"Panic in RPC HTTP handler", "err", e, "stack",
string(debug.Stack()),
)
rww.WriteHeader(http.StatusInternalServerError)
WriteRPCResponseHTTP(rww, types.RPCInternalError("", e.(error)))
WriteRPCResponseHTTPError(rww, http.StatusInternalServerError, types.RPCInternalError("", e.(error)))
}
}


Loading…
Cancel
Save