prevent data leakage when sending server.data
This commit is contained in:
@ -303,6 +303,16 @@ class ServerRegistration {
|
||||
message: message
|
||||
}
|
||||
}
|
||||
|
||||
getPublicData () {
|
||||
// Return a custom object instead of data directly to avoid data leakage
|
||||
return {
|
||||
name: this.data.name,
|
||||
ip: this.data.ip,
|
||||
type: this.data.type,
|
||||
color: this.data.color
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ServerRegistration
|
||||
|
Reference in New Issue
Block a user