Temporary fix for DDNSDomain leaks (#374)
This commit is contained in:
parent
cf9bbb5ff4
commit
aa9eb533ad
@ -238,9 +238,16 @@ func (cp *commonPage) getServerStat(c *gin.Context) ([]byte, error) {
|
||||
servers = singleton.SortedServerListForGuest
|
||||
}
|
||||
|
||||
filteredServers := make([]*model.Server, len(servers))
|
||||
for i, server := range servers {
|
||||
filteredServer := *server
|
||||
filteredServer.DDNSDomain = "redacted"
|
||||
filteredServers[i] = &filteredServer
|
||||
}
|
||||
|
||||
return utils.Json.Marshal(Data{
|
||||
Now: time.Now().Unix() * 1000,
|
||||
Servers: servers,
|
||||
Servers: filteredServers,
|
||||
})
|
||||
})
|
||||
return v.([]byte), err
|
||||
|
@ -53,9 +53,7 @@ func ReSortServer() {
|
||||
for _, s := range ServerList {
|
||||
SortedServerList = append(SortedServerList, s)
|
||||
if !s.HideForGuest {
|
||||
filteredStat := *s
|
||||
filteredStat.DDNSDomain = "redacted"
|
||||
SortedServerListForGuest = append(SortedServerListForGuest, &filteredStat)
|
||||
SortedServerListForGuest = append(SortedServerListForGuest, s)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user