[PR #4180] [MERGED] fix: secret variables being populated as undefined on code snippets #4688

Closed
opened 2026-03-17 02:12:07 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/4180
Author: @nivedin
Created: 7/10/2024
Status: Merged
Merged: 7/18/2024
Merged by: @jamesgeorge007

Base: patchHead: fix/code-snippet-secret-variable


📝 Commits (6)

  • 54289f8 chore: update httpsnippet dep
  • 5bf2161 chore: add param to show key if secret
  • 1bad0f2 chore: update to show key if secret
  • bd65079 fix: secret variable undefined in auth
  • 4156934 fix: update regex to skip < and > charecter replace
  • f13f1dc fix: decode URL string

📊 Changes

9 files changed (+134 additions, -87 deletions)

View changed files

📝 package.json (+1 -1)
📝 packages/hoppscotch-common/package.json (+1 -1)
📝 packages/hoppscotch-common/src/components/http/Codegen.vue (+1 -1)
📝 packages/hoppscotch-common/src/helpers/curl/curlparser.ts (+1 -1)
📝 packages/hoppscotch-common/src/helpers/curl/sub_helpers/url.ts (+1 -1)
📝 packages/hoppscotch-common/src/helpers/new-codegen/index.ts (+1 -1)
📝 packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts (+54 -21)
📝 packages/hoppscotch-data/src/environment/index.ts (+16 -4)
📝 pnpm-lock.yaml (+58 -56)

📄 Description

Closes HFE-530

This PR fixes the issue in code snippet where while using secret environment the variable was shown as undefined, now it shows the key of the variable.

What's changed

The bug is fixed, also the httpsnippet package has been updated, since the old package failed to decode the URL containing < & > character which we use as environment annotation.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/4180 **Author:** [@nivedin](https://github.com/nivedin) **Created:** 7/10/2024 **Status:** ✅ Merged **Merged:** 7/18/2024 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `patch` ← **Head:** `fix/code-snippet-secret-variable` --- ### 📝 Commits (6) - [`54289f8`](https://github.com/hoppscotch/hoppscotch/commit/54289f8e214d18027b2260f8d6d319b80ef530bd) chore: update httpsnippet dep - [`5bf2161`](https://github.com/hoppscotch/hoppscotch/commit/5bf2161d29149fdcc6184c8835c68b6cbd56aa23) chore: add param to show key if secret - [`1bad0f2`](https://github.com/hoppscotch/hoppscotch/commit/1bad0f25f9c240faa397f3fa3e30f74eb7212e4f) chore: update to show key if secret - [`bd65079`](https://github.com/hoppscotch/hoppscotch/commit/bd650794b45b1b4cdc06f4e32a32a02d83ff6726) fix: secret variable `undefined` in auth - [`4156934`](https://github.com/hoppscotch/hoppscotch/commit/415693452d381fc1a6ee1fefd6263d9657c545ac) fix: update regex to skip < and > charecter replace - [`f13f1dc`](https://github.com/hoppscotch/hoppscotch/commit/f13f1dc5fdb8fa664ce1c245cb096e2a106076ff) fix: decode URL string ### 📊 Changes **9 files changed** (+134 additions, -87 deletions) <details> <summary>View changed files</summary> 📝 `package.json` (+1 -1) 📝 `packages/hoppscotch-common/package.json` (+1 -1) 📝 `packages/hoppscotch-common/src/components/http/Codegen.vue` (+1 -1) 📝 `packages/hoppscotch-common/src/helpers/curl/curlparser.ts` (+1 -1) 📝 `packages/hoppscotch-common/src/helpers/curl/sub_helpers/url.ts` (+1 -1) 📝 `packages/hoppscotch-common/src/helpers/new-codegen/index.ts` (+1 -1) 📝 `packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts` (+54 -21) 📝 `packages/hoppscotch-data/src/environment/index.ts` (+16 -4) 📝 `pnpm-lock.yaml` (+58 -56) </details> ### 📄 Description Closes HFE-530 This PR fixes the issue in code snippet where while using secret environment the variable was shown as `undefined`, now it shows the key of the variable. ### What's changed The bug is fixed, also the `httpsnippet` package has been updated, since the old package failed to decode the URL containing < & > character which we use as environment annotation. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:12:07 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4688
No description provided.