Skip to content

Commit 55c33dd

Browse files
committed
try parsing advertised endpoint and fatal error if failing
1 parent 239ee0b commit 55c33dd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"context"
2727
"fmt"
2828
"io/ioutil"
29+
"net/url"
2930
"os"
3031
"os/signal"
3132
"path/filepath"
@@ -569,6 +570,11 @@ func mustPrepareService(generateAutoKeyFile bool) (*service.Service, service.Boo
569570
log.Fatal().Err(err).Msgf("Unsupport image pull policy '%s'", dockerImagePullPolicy)
570571
}
571572

573+
// Sanity checking URL scheme on advertised endpoints
574+
if _, err := url.Parse(advertisedEndpoint); err != nil {
575+
log.Fatal().Err(err).Msgf("Advertised cluster endpoint %s does not meet URL standards", advertisedEndpoint)
576+
}
577+
572578
// Expand home-dis (~) in paths
573579
arangodPath = mustExpand(arangodPath)
574580
arangodJSPath = mustExpand(arangodJSPath)

0 commit comments

Comments
 (0)