mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-11 14:21:18 +00:00
Enable basic authentication in the RPC client using the https://username:password@node:port format. Issue #4248 has details about what was refactored/enhanced (it's not as bad as it looks.) I'm open to suggestions on where/how the documentation should be updated. Please note that PR #4284 is superseded with this PR. The reason for this is because both PR makes changes to the same code.
23 lines
464 B
Go
23 lines
464 B
Go
package rpcclient
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestHTTPClientMakeHTTPDialer(t *testing.T) {
|
|
remote := []string{"https://foo-bar.com:80", "http://foo-bar.net:80", "https://user:pass@foo-bar.net:80"}
|
|
|
|
for _, f := range remote {
|
|
u, err := newParsedURL(f)
|
|
require.NoError(t, err)
|
|
dialFn := makeHTTPDialer(f)
|
|
|
|
addr, err := dialFn(u.Scheme, u.GetHostWithPath())
|
|
require.NoError(t, err)
|
|
require.NotNil(t, addr)
|
|
}
|
|
|
|
}
|