You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
Support __proto__ and similar as object attribute in hgetall
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
var RawObject = require('./rawObject');
|
||||
|
||||
// hgetall converts its replies to an Object. If the reply is empty, null is returned.
|
||||
// These function are only called with internal data and have therefor always the same instanceof X
|
||||
function replyToObject (reply) {
|
||||
@@ -7,7 +9,7 @@ function replyToObject (reply) {
|
||||
if (reply.length === 0 || !(reply instanceof Array)) {
|
||||
return null;
|
||||
}
|
||||
var obj = {};
|
||||
var obj = new RawObject();
|
||||
for (var i = 0; i < reply.length; i += 2) {
|
||||
obj[reply[i].toString('binary')] = reply[i + 1];
|
||||
}
|
||||
|
Reference in New Issue
Block a user