From 1afc21ac64ac446a1c87f14d1219eb51958a3ab8 Mon Sep 17 00:00:00 2001 From: evilsocket Date: Wed, 12 Sep 2018 12:58:57 +0200 Subject: [PATCH] fix: displaying a warning message if the api.rest module authentication is disabled --- modules/api_rest.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/api_rest.go b/modules/api_rest.go index 4ef64fe0..de78de32 100644 --- a/modules/api_rest.go +++ b/modules/api_rest.go @@ -180,6 +180,10 @@ func (api *RestAPI) Configure() error { api.server.Handler = router + if api.username == "" || api.password == "" { + log.Warning("api.rest.username and/or api.rest.password parameters are empty, authentication is disabled.") + } + return nil } @@ -192,10 +196,10 @@ func (api *RestAPI) Start() error { var err error if api.isTLS() { - log.Info("API server starting on https://%s", api.server.Addr) + log.Info("api server starting on https://%s", api.server.Addr) err = api.server.ListenAndServeTLS(api.certFile, api.keyFile) } else { - log.Info("API server starting on http://%s", api.server.Addr) + log.Info("api server starting on http://%s", api.server.Addr) err = api.server.ListenAndServe() }