From 21536f9a27666a35e151e0579f7c35ec7ff88c17 Mon Sep 17 00:00:00 2001 From: Sebastien Dionne Date: Sat, 7 Oct 2023 15:28:17 -0400 Subject: [PATCH] Support request name with "index" in the name if index is not separated --- .../bruno-app/src/components/Sidebar/NewRequest/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/bruno-app/src/components/Sidebar/NewRequest/index.js b/packages/bruno-app/src/components/Sidebar/NewRequest/index.js index f5753aced..55be133b8 100644 --- a/packages/bruno-app/src/components/Sidebar/NewRequest/index.js +++ b/packages/bruno-app/src/components/Sidebar/NewRequest/index.js @@ -30,7 +30,10 @@ const NewRequest = ({ collection, item, isEphemeral, onClose }) => { .test({ name: 'requestName', message: 'The request name "index" is reserved in bruno', - test: (value) => value && !value.trim().toLowerCase().includes('index') + test: (value) => { + const regex = /(\s|^)\W*index\W*(\s|$)/i; + return value && !regex.test(value); + } }) }), onSubmit: (values) => {