Merge pull request #129 from JensHeinrich/patch-2

Update server.go
This commit is contained in:
Laszlo Fogas 2020-08-10 09:14:37 +02:00 committed by GitHub
commit 9c2478bbda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -526,18 +526,18 @@ func server(c *cli.Context) error {
// must configure the drone_host variable // must configure the drone_host variable
if c.String("server-host") == "" { if c.String("server-host") == "" {
logrus.Fatalln("DRONE_HOST is not properly configured") logrus.Fatalln("DRONE_HOST/DRONE_SERVER_HOST is not properly configured")
} }
if !strings.Contains(c.String("server-host"), "://") { if !strings.Contains(c.String("server-host"), "://") {
logrus.Fatalln( logrus.Fatalln(
"DRONE_HOST must be <scheme>://<hostname> format", "DRONE_HOST/DRONE_SERVER_HOST must be <scheme>://<hostname> format",
) )
} }
if strings.HasSuffix(c.String("server-host"), "/") { if strings.HasSuffix(c.String("server-host"), "/") {
logrus.Fatalln( logrus.Fatalln(
"DRONE_HOST must not have trailing slash", "DRONE_HOST/DRONE_SERVER_HOST must not have trailing slash",
) )
} }