Skip to content

Commit

Permalink
cli: ignore trailing / in repository server URL (#569)
Browse files Browse the repository at this point in the history
Fixes #557
  • Loading branch information
jkowalski committed Aug 30, 2020
1 parent 0dbaae1 commit 965160d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/command_repository_connect_server.go
Expand Up @@ -23,7 +23,7 @@ func runConnectAPIServerCommand(ctx context.Context) error {
}

as := &repo.APIServerInfo{
BaseURL: *connectAPIServerURL,
BaseURL: strings.TrimSuffix(*connectAPIServerURL, "/"),
TrustedServerCertificateFingerprint: strings.ToLower(*connectAPIServerCertFingerprint),
}

Expand Down
2 changes: 1 addition & 1 deletion tests/end_to_end_test/api_server_repository_test.go
Expand Up @@ -71,7 +71,7 @@ func TestAPIServerRepository(t *testing.T) {
defer e2.RunAndExpectSuccess(t, "repo", "disconnect")

e2.RunAndExpectSuccess(t, "repo", "connect", "server",
"--url", sp.baseURL,
"--url", sp.baseURL+"/",
"--server-cert-fingerprint", sp.sha256Fingerprint,
"--override-username", "foo",
"--override-hostname", "bar",
Expand Down

0 comments on commit 965160d

Please sign in to comment.