Files
tendermint/rpc/lib/client/http_client_test.go
Greg Szabo be771f225a rpc/lib: RPC client basic authentication with URL parsing refactored (#4285)
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.
2020-01-10 12:30:56 -08:00

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)
}
}