Skip to content

Commit

Permalink
missed parsing of target url
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-deboer committed Jun 16, 2017
1 parent c045e93 commit 26b1b4e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,16 @@ func parseFlags(c *cli.Context) (creds *authContext, targetURL *url.URL) {
creds.AuthEndpoint = authEndpoint
}

if len(target) > 0 {
t, err := url.Parse(target)
if err != nil {
println(fmt.Sprintf("ERROR: 'target' %s is invalid: %v\n", target, err))
cli.ShowAppHelp(c)
os.Exit(1)
}
targetURL = t
}

} else {

if len(secret) == 0 && len(secretFile) == 0 {
Expand Down

0 comments on commit 26b1b4e

Please sign in to comment.