fix(phase-1): redact API key query params from log output and add mutex thread-safety to providers map
This commit is contained in:
@@ -82,7 +82,7 @@ func (s *Server) handleGetProviders(c *gin.Context) {
|
||||
|
||||
status := "disabled"
|
||||
if enabled {
|
||||
if _, ok := s.providers[id]; ok {
|
||||
if _, ok := s.getProvider(id); ok {
|
||||
status = "online"
|
||||
} else {
|
||||
status = "error"
|
||||
@@ -203,7 +203,7 @@ func (s *Server) handleUpdateProvider(c *gin.Context) {
|
||||
|
||||
func (s *Server) handleTestProvider(c *gin.Context) {
|
||||
name := c.Param("name")
|
||||
provider, ok := s.providers[name]
|
||||
provider, ok := s.getProvider(name)
|
||||
if !ok {
|
||||
c.JSON(http.StatusNotFound, ErrorResponse(fmt.Sprintf("Provider %s not found or not enabled", name)))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user