Skip to content

Commit b883b2a

Browse files
authored
Merge pull request #2866 from tf-nphillips/Issue-2865_AllowHyphensInNodeNames
support hyphens in node names
2 parents 8a17c0d + c3afcda commit b883b2a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

redisinsight/api/src/modules/browser/utils/clusterCursor.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const isClusterCursorValidTests = [
1515
},
1616
{ input: '172.17.0.1:7001@-1', expected: true },
1717
{ input: 'domain.com:7001@-1', expected: true },
18+
{ input: 'domain-with-hyphens.com:7001@-1', expected: true },
1819
{ input: '172.17.0.1:7001@1228822', expected: true },
1920
{ input: '172.17.0.1:7001@', expected: false },
2021
{ input: '172.17.0.1:7001@text', expected: false },

redisinsight/api/src/modules/browser/utils/clusterCursor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { IGetNodeKeysResult } from 'src/modules/browser/services/keys-business/s
44
const NODES_SEPARATOR = '||';
55
const CURSOR_SEPARATOR = '@';
66
// Correct format 172.17.0.1:7001@-1||172.17.0.1:7002@33
7-
const CLUSTER_CURSOR_REGEX = /^(([a-z0-9.])+:[0-9]+(@-?\d+)(?:\|{2}(?!$)|$))+$/;
7+
const CLUSTER_CURSOR_REGEX = /^(([a-z0-9.-])+:[0-9]+(@-?\d+)(?:\|{2}(?!$)|$))+$/;
88

99
export const isClusterCursorValid = (cursor) => CLUSTER_CURSOR_REGEX.test(cursor);
1010

0 commit comments

Comments
 (0)