Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ecd5ee1

Browse files
authoredMay 3, 2023
Struct Client exposes sensitive data (celestiaorg#784)
1 parent feac56b commit ecd5ee1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎rpc/jsonrpc/client/http_json_client.go

+6
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ var _ HTTPClient = (*Client)(nil)
139139
var _ Caller = (*Client)(nil)
140140
var _ Caller = (*RequestBatch)(nil)
141141

142+
var _ fmt.Stringer = (*Client)(nil)
143+
142144
// New returns a Client pointed at the given address.
143145
// An error is returned on invalid remote. The function panics when remote is nil.
144146
func New(remote string) (*Client, error) {
@@ -232,6 +234,10 @@ func getHTTPRespErrPrefix(resp *http.Response) string {
232234
return fmt.Sprintf("error in json rpc client, with http response metadata: (Status: %s, Protocol %s)", resp.Status, resp.Proto)
233235
}
234236

237+
func (c *Client) String() string {
238+
return fmt.Sprintf("&Client{user=%v, addr=%v, client=%v, nextReqID=%v}", c.username, c.address, c.client, c.nextReqID)
239+
}
240+
235241
// NewRequestBatch starts a batch of requests for this client.
236242
func (c *Client) NewRequestBatch() *RequestBatch {
237243
return &RequestBatch{

0 commit comments

Comments
 (0)
Please sign in to comment.