You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
Send client user-agent during connection, via CLIENT SETINFO (#2645)
* Add SETINFO support to client connection, with the ability to disable sending the user agent if the end user desires. * Also enables modifying the user-agent with a tag to enable distinguishing different usages.
This commit is contained in:
@@ -31,6 +31,9 @@ export interface ClientInfoReply {
|
||||
user?: string; // 6.0
|
||||
redir?: number; // 6.2
|
||||
resp?: number; // 7.0
|
||||
// 7.2
|
||||
libName?: string;
|
||||
libVer?: string;
|
||||
}
|
||||
|
||||
const CLIENT_INFO_REGEX = /([^\s=]+)=([^\s]*)/g;
|
||||
@@ -62,7 +65,9 @@ export function transformReply(rawReply: string): ClientInfoReply {
|
||||
totMem: Number(map['tot-mem']),
|
||||
events: map.events,
|
||||
cmd: map.cmd,
|
||||
user: map.user
|
||||
user: map.user,
|
||||
libName: map['lib-name'],
|
||||
libVer: map['lib-ver'],
|
||||
};
|
||||
|
||||
if (map.laddr !== undefined) {
|
||||
|
Reference in New Issue
Block a user