From d22918d3e21e25e1ed87f6717bbc8c80f3135b68 Mon Sep 17 00:00:00 2001 From: Ry Racherbaumer Date: Tue, 28 Nov 2023 20:30:08 -0600 Subject: [PATCH] refactor: narrow character range --- src/utils/topic.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/topic.ts b/src/utils/topic.ts index 6bff0ec57..7e4b25e63 100644 --- a/src/utils/topic.ts +++ b/src/utils/topic.ts @@ -36,10 +36,10 @@ export const buildUserPrivateStoreTopic = (addrPrefixedKey: string): string => { return buildContentTopic(`privatestore-${addrPrefixedKey}`) } -// validate that a topic only contains ASCII characters +// validate that a topic only contains ASCII characters 33-127 export const isValidTopic = (topic: string): boolean => { // eslint-disable-next-line no-control-regex - const regex = /^[\x00-\x7F]+$/ + const regex = /^[\x21-\x7F]+$/ const index = topic.indexOf('0/') if (index !== -1) { const unwrappedTopic = topic.substring(