Validate DRONE_HOST to ensure it contains a scheme and not a trailing slash
This commit is contained in:
parent
1db7bde877
commit
453f415cc4
1 changed files with 12 additions and 0 deletions
|
@ -477,6 +477,18 @@ func server(c *cli.Context) error {
|
|||
logrus.Fatalln("DRONE_HOST is not properly configured")
|
||||
}
|
||||
|
||||
if !strings.Contains(c.String("server-host"), "://") {
|
||||
logrus.Fatalln(
|
||||
"DRONE_HOST must be <scheme>://<hostname> format",
|
||||
)
|
||||
}
|
||||
|
||||
if !strings.HasSuffix(c.String("server-host"), "/") {
|
||||
logrus.Fatalln(
|
||||
"DRONE_HOST must not have trailing slash",
|
||||
)
|
||||
}
|
||||
|
||||
remote_, err := SetupRemote(c)
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
|
|
Loading…
Reference in a new issue