Skip to content

Commit 565828b

Browse files
committed
Support login host without protocol scheme
1 parent da824ae commit 565828b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

components/local-app/cmd/login.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"log/slog"
1212
"net/url"
1313
"os"
14+
"strings"
1415
"time"
1516

1617
"github.com/bufbuild/connect-go"
@@ -37,6 +38,9 @@ var loginCmd = &cobra.Command{
3738
RunE: func(cmd *cobra.Command, args []string) error {
3839
cmd.SilenceUsage = true
3940

41+
if !strings.HasPrefix(loginOpts.Host, "http") {
42+
loginOpts.Host = "https://" + loginOpts.Host
43+
}
4044
host, err := url.Parse(loginOpts.Host)
4145
if err != nil {
4246
return fmt.Errorf("cannot parse host %s: %w", loginOpts.Host, err)

0 commit comments

Comments
 (0)