fix RecoverAndLogHandler not to call multiple writeheader (#2688)

This commit is contained in:
Jun Kimura 2018-10-24 17:07:33 +09:00 committed by Anton Kaliaev
parent be929acd6a
commit 9795e12ef2

View File

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