From 3c35bb6091676fe4f079cde642e0fbc2e899fb35 Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Mon, 3 Oct 2022 14:51:10 +0530 Subject: [PATCH] fix: issue with non-alphanumeric characters within body env variables (fixes #2665) --- packages/hoppscotch-app/package.json | 2 +- packages/hoppscotch-cli/package.json | 2 +- packages/hoppscotch-data/package.json | 2 +- packages/hoppscotch-data/src/environment.ts | 2 +- packages/hoppscotch-js-sandbox/package.json | 2 +- pnpm-lock.yaml | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/hoppscotch-app/package.json b/packages/hoppscotch-app/package.json index ebc0ffef4..d066bb8d0 100644 --- a/packages/hoppscotch-app/package.json +++ b/packages/hoppscotch-app/package.json @@ -35,7 +35,7 @@ "@codemirror/state": "^6.1.0", "@codemirror/view": "^6.0.2", "@hoppscotch/codemirror-lang-graphql": "workspace:^0.2.0", - "@hoppscotch/data": "workspace:^0.4.2", + "@hoppscotch/data": "workspace:^0.4.4", "@hoppscotch/js-sandbox": "workspace:^2.1.0", "@hoppscotch/vue-toasted": "^0.1.0", "@lezer/highlight": "^1.0.0", diff --git a/packages/hoppscotch-cli/package.json b/packages/hoppscotch-cli/package.json index 4b20666a6..c86ec635b 100644 --- a/packages/hoppscotch-cli/package.json +++ b/packages/hoppscotch-cli/package.json @@ -36,7 +36,7 @@ "license": "MIT", "private": false, "devDependencies": { - "@hoppscotch/data": "workspace:^0.4.3", + "@hoppscotch/data": "workspace:^0.4.4", "@hoppscotch/js-sandbox": "workspace:^2.0.0", "@relmify/jest-fp-ts": "^2.0.2", "@swc/core": "^1.2.181", diff --git a/packages/hoppscotch-data/package.json b/packages/hoppscotch-data/package.json index 04628cf79..0953213e4 100644 --- a/packages/hoppscotch-data/package.json +++ b/packages/hoppscotch-data/package.json @@ -1,6 +1,6 @@ { "name": "@hoppscotch/data", - "version": "0.4.3", + "version": "0.4.4", "description": "Data Types, Validations and Migrations for Hoppscotch Public Data Structures", "type": "module", "main": "dist/hoppscotch-data.cjs", diff --git a/packages/hoppscotch-data/src/environment.ts b/packages/hoppscotch-data/src/environment.ts index 415977344..cfc50b3e8 100644 --- a/packages/hoppscotch-data/src/environment.ts +++ b/packages/hoppscotch-data/src/environment.ts @@ -30,7 +30,7 @@ export function parseBodyEnvVariablesE( let depth = 0 while (result.match(REGEX_ENV_VAR) != null && depth <= ENV_MAX_EXPAND_LIMIT) { - result = result.replace(/<<\w+>>/g, (key) => { + result = result.replace(REGEX_ENV_VAR, (key) => { const found = env.find( (envVar) => envVar.key === key.replace(/[<>]/g, "") ) diff --git a/packages/hoppscotch-js-sandbox/package.json b/packages/hoppscotch-js-sandbox/package.json index f15e20a5c..2041bf0a7 100644 --- a/packages/hoppscotch-js-sandbox/package.json +++ b/packages/hoppscotch-js-sandbox/package.json @@ -40,7 +40,7 @@ "author": "Hoppscotch (support@hoppscotch.io)", "license": "MIT", "dependencies": { - "@hoppscotch/data": "workspace:^0.4.3", + "@hoppscotch/data": "workspace:^0.4.4", "fp-ts": "^2.11.10", "lodash": "^4.17.21", "quickjs-emscripten": "^0.15.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0b91db3f4..a26144c7b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -65,7 +65,7 @@ importers: '@graphql-codegen/urql-introspection': ^2.2.0 '@graphql-typed-document-node/core': ^3.1.1 '@hoppscotch/codemirror-lang-graphql': workspace:^0.2.0 - '@hoppscotch/data': workspace:^0.4.2 + '@hoppscotch/data': workspace:^0.4.4 '@hoppscotch/js-sandbox': workspace:^2.1.0 '@hoppscotch/vue-toasted': ^0.1.0 '@iconify-json/lucide': ^1.1.40 @@ -295,7 +295,7 @@ importers: packages/hoppscotch-cli: specifiers: - '@hoppscotch/data': workspace:^0.4.3 + '@hoppscotch/data': workspace:^0.4.4 '@hoppscotch/js-sandbox': workspace:^2.0.0 '@relmify/jest-fp-ts': ^2.0.2 '@swc/core': ^1.2.181 @@ -365,7 +365,7 @@ importers: packages/hoppscotch-js-sandbox: specifiers: '@digitak/esrun': ^3.1.2 - '@hoppscotch/data': workspace:^0.4.3 + '@hoppscotch/data': workspace:^0.4.4 '@relmify/jest-fp-ts': ^2.0.1 '@types/jest': ^27.4.1 '@types/lodash': ^4.14.181