Skip to content

Commit 86ee484

Browse files
committed
Merge pull request #426 from mboersma/fix-cli-open
fix(cmd/apps): simplify URL prefixing
2 parents de21562 + 7508e00 commit 86ee484

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

client/cmd/apps.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package cmd
22

33
import (
44
"fmt"
5-
"net/url"
65
"os"
76
"strings"
87
"time"
@@ -142,15 +141,12 @@ func AppOpen(appID string) error {
142141
return err
143142
}
144143

145-
u, err := url.Parse(app.URL)
146-
147-
if err != nil {
148-
return err
144+
u := app.URL
145+
if !(strings.HasPrefix(u, "http://") || strings.HasPrefix(u, "https://")) {
146+
u = "http://" + u
149147
}
150148

151-
u.Scheme = "http"
152-
153-
return webbrowser.Webbrowser(u.String())
149+
return webbrowser.Webbrowser(u)
154150
}
155151

156152
// AppLogs returns the logs from an app.

0 commit comments

Comments
 (0)