Skip to content

Commit

Permalink
fix(login): validate URL is well formed fixes #2427
Browse files Browse the repository at this point in the history
  • Loading branch information
rawlingsj committed Dec 7, 2018
1 parent d9e8d65 commit b5bc12f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/jx/cmd/login.go
Expand Up @@ -8,6 +8,7 @@ import (
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -99,8 +100,13 @@ func NewCmdLogin(f Factory, in terminal.FileReader, out terminal.FileWriter, err

func (o *LoginOptions) Run() error {

_, err := url.ParseRequestURI(o.URL)
if err != nil {
return errors.Wrap(err, "validation failed for URL, ensure URL is well formed including scheme, i.e. https://foo.com")
}

// ensure base set of binaries are installed which are required by jx
err := o.installRequirements("")
err = o.installRequirements("")
if err != nil {
return errors.Wrap(err, "installing required binaries")
}
Expand Down

0 comments on commit b5bc12f

Please sign in to comment.