prevent data leakage when sending server.data

This commit is contained in:
Nick Krecklow
2020-05-08 16:22:24 -05:00
parent 9cb9e4a062
commit f6780e7a9b
2 changed files with 11 additions and 1 deletions

View File

@ -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