mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 09:16:03 +03:00
[GH-ISSUE #4672] [bug]: Whitespace in environment vars break CodeSnippet generation #1735
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#1735
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @piscis on GitHub (Jan 13, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4672
Is there an existing issue for this?
Current behavior
I noticed that the Code Snippets generation fails if an url contains references to an environment variable with unescaped whitespaces.
For Example
If I have the following url:
https://echo.hoppscotch.io/?query=abc 123and setup a Request eg.https://echo.hoppscotch.io/?query=<<unescapedWhitespace>>with a variableabc 123then I get the following error while generating a CodeSnippetwith a javascript client error:
Steps to reproduce
https://echo.hoppscotch.io/?query=abc 123abc 123name itunescapedWhitespacehttps://echo.hoppscotch.io/?query=<<unescapedWhitespace>>Something went wrongWorkaround:
To fix the error replace the white space in
unescapedWhitespacewith an encoded white space so the value readsabc%20123Run CodeSnippet again it should display a code snippet:
Environment
Production
Version
Self-hosted
Docker: hoppscotch/hoppscotch:2024.12.0
Ubuntu 24.04
@yousefmarey12 commented on GitHub (Jan 14, 2025):
hey, I'll work on this.