You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-11 22:42:42 +03:00
chore: guard against inherited properties
This commit is contained in:
@@ -85,7 +85,9 @@ RedisClient.prototype.duplicate = function (options, callback) {
|
||||
const existingOptions = utils.clone(this.options)
|
||||
options = utils.clone(options)
|
||||
for (const elem in options) {
|
||||
existingOptions[elem] = options[elem]
|
||||
if (options.hasOwnProperty(elem)) {
|
||||
existingOptions[elem] = options[elem]
|
||||
}
|
||||
}
|
||||
const client = new RedisClient(existingOptions)
|
||||
client.selectedDb = this.selectedDb
|
||||
|
Reference in New Issue
Block a user