You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
fix: accept UPPER_CASE commands in send_command
This commit is contained in:
@@ -705,7 +705,6 @@ accessed via the redis SELECT command. Each DB could use its own connection.
|
|||||||
|
|
||||||
All Redis commands have been added to the `client` object. However, if new commands are introduced before this library is updated,
|
All Redis commands have been added to the `client` object. However, if new commands are introduced before this library is updated,
|
||||||
you can use `send_command()` to send arbitrary commands to Redis.
|
you can use `send_command()` to send arbitrary commands to Redis.
|
||||||
The command_name has to be lower case.
|
|
||||||
|
|
||||||
All commands are sent as multi-bulk commands. `args` can either be an Array of arguments, or omitted / set to undefined.
|
All commands are sent as multi-bulk commands. `args` can either be an Array of arguments, or omitted / set to undefined.
|
||||||
|
|
||||||
|
@@ -1,6 +1,10 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## v.2.7.2 - 14 Mar, 2017
|
## v.2.8.0 - 20 Jul, 2017
|
||||||
|
|
||||||
|
Features
|
||||||
|
|
||||||
|
- Accept UPPER_CASE commands in send_command
|
||||||
|
|
||||||
Bugfixes
|
Bugfixes
|
||||||
|
|
||||||
|
@@ -16,6 +16,7 @@ RedisClient.prototype.send_command = RedisClient.prototype.sendCommand = functio
|
|||||||
if (typeof command !== 'string') {
|
if (typeof command !== 'string') {
|
||||||
throw new TypeError('Wrong input type "' + (command !== null && command !== undefined ? command.constructor.name : command) + '" for command name');
|
throw new TypeError('Wrong input type "' + (command !== null && command !== undefined ? command.constructor.name : command) + '" for command name');
|
||||||
}
|
}
|
||||||
|
command = command.toLowerCase();
|
||||||
if (!Array.isArray(args)) {
|
if (!Array.isArray(args)) {
|
||||||
if (args === undefined || args === null) {
|
if (args === undefined || args === null) {
|
||||||
args = [];
|
args = [];
|
||||||
@@ -32,9 +33,9 @@ RedisClient.prototype.send_command = RedisClient.prototype.sendCommand = functio
|
|||||||
|
|
||||||
// Using the raw multi command is only possible with this function
|
// Using the raw multi command is only possible with this function
|
||||||
// If the command is not yet added to the client, the internal function should be called right away
|
// If the command is not yet added to the client, the internal function should be called right away
|
||||||
// Otherwise we need to redirect the calls to make sure the interal functions don't get skipped
|
// Otherwise we need to redirect the calls to make sure the internal functions don't get skipped
|
||||||
// The internal functions could actually be used for any non hooked function
|
// The internal functions could actually be used for any non hooked function
|
||||||
// but this might change from time to time and at the moment there's no good way to distinguishe them
|
// but this might change from time to time and at the moment there's no good way to distinguish them
|
||||||
// from each other, so let's just do it do it this way for the time being
|
// from each other, so let's just do it do it this way for the time being
|
||||||
if (command === 'multi' || typeof this[command] !== 'function') {
|
if (command === 'multi' || typeof this[command] !== 'function') {
|
||||||
return this.internal_send_command(new Command(command, args, callback));
|
return this.internal_send_command(new Command(command, args, callback));
|
||||||
|
Reference in New Issue
Block a user