diff --git a/ssas/service/api_common_test.go b/ssas/service/api_common_test.go index c17d244..24bb0e3 100644 --- a/ssas/service/api_common_test.go +++ b/ssas/service/api_common_test.go @@ -25,7 +25,7 @@ func (s *APICommonTestSuite) SetupSuite() { func (s *APICommonTestSuite) TestJSONError() { // JSON output is valid for simple strings w := httptest.NewRecorder() - JSONError(w, http.StatusUnauthorized, http.StatusText(http.StatusUnauthorized), "unauthorized") + JSONError(w, http.StatusUnauthorized, http.StatusText(http.StatusUnauthorized), "unauthorized", nil) resp := w.Result() body, err := io.ReadAll(resp.Body) assert.NoError(s.T(), err) diff --git a/ssas/service/server.go b/ssas/service/server.go index 9963832..33e8f32 100644 --- a/ssas/service/server.go +++ b/ssas/service/server.go @@ -9,7 +9,6 @@ import ( b64 "encoding/base64" "errors" "fmt" - "log" "net/http" "os" "strings" @@ -170,23 +169,23 @@ func (s *Server) Serve() { logger := log2.GetCtxLogger(context.Background()) if s.notSecure { logger.Infof("starting %s server running UNSAFE http only mode; do not do this in production environments", s.name) - go func() { log.Fatal(s.server.ListenAndServe()) }() + go func() { logger.Fatal(s.server.ListenAndServe()) }() } else { if s.useMTLS { conf, err := BuildMTLSConfig() if err != nil { - log.Fatal(err) + logger.Fatal(err) } s.server.TLSConfig = conf //If cert and key file paths are not passed the certs in TLS configs are used. logger.Infof("starting %s server in MTLS mode", s.name) - go func() { log.Fatal(s.server.ListenAndServeTLS("", "")) }() + go func() { logger.Fatal(s.server.ListenAndServeTLS("", "")) }() } else { tlsCertPath := os.Getenv("BCDA_TLS_CERT") // borrowing for now; we need to get our own (for both servers?) tlsKeyPath := os.Getenv("BCDA_TLS_KEY") logger.Infof("starting %s server in TLS mode", s.name) - go func() { log.Fatal(s.server.ListenAndServeTLS(tlsCertPath, tlsKeyPath)) }() + go func() { logger.Fatal(s.server.ListenAndServeTLS(tlsCertPath, tlsKeyPath)) }() } } }