Only expose sessions data in debug mode, otherwise return just a count of sessions
This commit is contained in:
@@ -56,7 +56,14 @@ func GetAsset(c *gin.Context) {
|
||||
}
|
||||
|
||||
func GetSessions(c *gin.Context) {
|
||||
c.JSON(200, DbSessions)
|
||||
// In debug mode endpoint will return a lot of sensitive information
|
||||
// like full database connection string and all query history.
|
||||
if command.Opts.Debug {
|
||||
c.JSON(200, DbSessions)
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(200, map[string]int{"sessions": len(DbSessions)})
|
||||
}
|
||||
|
||||
func Connect(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user