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
|
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{
|
return utils.Json.Marshal(Data{
|
||||||
Now: time.Now().Unix() * 1000,
|
Now: time.Now().Unix() * 1000,
|
||||||
Servers: servers,
|
Servers: filteredServers,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
return v.([]byte), err
|
return v.([]byte), err
|
||||||
|
@ -53,9 +53,7 @@ func ReSortServer() {
|
|||||||
for _, s := range ServerList {
|
for _, s := range ServerList {
|
||||||
SortedServerList = append(SortedServerList, s)
|
SortedServerList = append(SortedServerList, s)
|
||||||
if !s.HideForGuest {
|
if !s.HideForGuest {
|
||||||
filteredStat := *s
|
SortedServerListForGuest = append(SortedServerListForGuest, s)
|
||||||
filteredStat.DDNSDomain = "redacted"
|
|
||||||
SortedServerListForGuest = append(SortedServerListForGuest, &filteredStat)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user