1
0
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:
Shaya Potter
2023-11-07 14:43:20 +02:00
committed by GitHub
parent c64ce74383
commit a8b81bdd01
6 changed files with 90 additions and 5 deletions

View File

@@ -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) {