Check that -server-url begins with an https:// (#168)

This commit is contained in:
Jesse Peterson
2017-05-24 11:02:54 -07:00
committed by GitHub
parent 316053b065
commit c08c8e9035

View File

@@ -106,6 +106,9 @@ func serve(args []string) error {
if *flServerURL == "" {
return errors.New("must supply -server-url")
}
if !strings.HasPrefix(*flServerURL, "https://") {
return errors.New("-server-url must begin with https://")
}
logger := log.NewLogfmtLogger(os.Stderr)
stdlog.SetOutput(log.NewStdlibAdapter(logger)) // force structured logs