From 36e9a9c137aa71dbf05c4d90e4839dc4d4cced11 Mon Sep 17 00:00:00 2001 From: Siddharth Gelera Date: Mon, 10 Nov 2025 18:14:00 +0530 Subject: [PATCH] fix: reset TEMPLATE_VAR_PATTERN lastIndex in URL validation --- .../Collection/CollectionItem/GenerateCodeItem/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/GenerateCodeItem/index.js b/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/GenerateCodeItem/index.js index 728cb7a7b..1557b06f1 100644 --- a/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/GenerateCodeItem/index.js +++ b/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/GenerateCodeItem/index.js @@ -19,6 +19,7 @@ const TEMPLATE_VAR_PATTERN = /\{\{([^}]+)\}\}/g; const validateURLWithVars = (url) => { const isValid = isValidUrl(url); const hasMissingInterpolations = TEMPLATE_VAR_PATTERN.test(url); + TEMPLATE_VAR_PATTERN.lastIndex = 0; return isValid && !hasMissingInterpolations; };