Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(jsonrpc): enable HTTP basic auth in WS client (#2434)
Hello, I noticed that the JSON-RPC client is compatible with URLs containing **HTTP basic auth**, but not on the WebSocket side. For instance: ```golang client, err := http.New("https://foo:bar@example.org:443", "/websocket") client.Block(ctx, nil) // works client.Start() // websocket error: the client doesn't forward auth headers ``` The HTTP client handle the username/password from the given endpoint correctly: - https://github.com/cometbft/cometbft/blob/v0.38.5/rpc/jsonrpc/client/http_json_client.go#L140-L141 - https://github.com/cometbft/cometbft/blob/v0.38.5/rpc/jsonrpc/client/http_json_client.go#L184-L185 So this PR brings the same logic for the WS client. --- #### PR checklist - [ ] Tests written/updated - [x] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec
- Loading branch information