mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-14 17:41:43 +08:00
Check that -server-url begins with an https:// (#168)
This commit is contained in:
3
serve.go
3
serve.go
@@ -106,6 +106,9 @@ func serve(args []string) error {
|
|||||||
if *flServerURL == "" {
|
if *flServerURL == "" {
|
||||||
return errors.New("must supply -server-url")
|
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)
|
logger := log.NewLogfmtLogger(os.Stderr)
|
||||||
stdlog.SetOutput(log.NewStdlibAdapter(logger)) // force structured logs
|
stdlog.SetOutput(log.NewStdlibAdapter(logger)) // force structured logs
|
||||||
|
|||||||
Reference in New Issue
Block a user