You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
chore: guard against inherited properties
This commit is contained in:
14
index.js
14
index.js
@@ -40,10 +40,12 @@ function RedisClient (options, stream) {
|
||||
const cnxOptions = {}
|
||||
/* istanbul ignore next: travis does not work with stunnel atm. Therefore the tls tests are skipped on travis */
|
||||
for (const tlsOption in options.tls) {
|
||||
cnxOptions[tlsOption] = options.tls[tlsOption]
|
||||
// Copy the tls options into the general options to make sure the address is set right
|
||||
if (tlsOption === 'port' || tlsOption === 'host' || tlsOption === 'path' || tlsOption === 'family') {
|
||||
options[tlsOption] = options.tls[tlsOption]
|
||||
if (options.tls.hasOwnProperty(tlsOption)) {
|
||||
cnxOptions[tlsOption] = options.tls[tlsOption]
|
||||
// Copy the tls options into the general options to make sure the address is set right
|
||||
if (tlsOption === 'port' || tlsOption === 'host' || tlsOption === 'path' || tlsOption === 'family') {
|
||||
options[tlsOption] = options.tls[tlsOption]
|
||||
}
|
||||
}
|
||||
}
|
||||
if (stream) {
|
||||
@@ -69,7 +71,9 @@ function RedisClient (options, stream) {
|
||||
options.socketKeepalive = true
|
||||
}
|
||||
for (const command in options.renameCommands) {
|
||||
options.renameCommands[command.toLowerCase()] = options.renameCommands[command]
|
||||
if (options.renameCommands.hasOwnProperty(command)) {
|
||||
options.renameCommands[command.toLowerCase()] = options.renameCommands[command]
|
||||
}
|
||||
}
|
||||
options.returnBuffers = !!options.returnBuffers
|
||||
options.detectBuffers = !!options.detectBuffers
|
||||
|
Reference in New Issue
Block a user