Fix: File path fails when used in env vars on Windows [INS-4742]#8221
Merged
filfreire merged 3 commits intoDec 16, 2024
Merged
Fix: File path fails when used in env vars on Windows [INS-4742]#8221filfreire merged 3 commits into
filfreire merged 3 commits into
Conversation
gatzjames
approved these changes
Dec 13, 2024
gatzjames
left a comment
Contributor
There was a problem hiding this comment.
Tested on Windows and macOS LGTM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
When we do a double-escape of the
\slash ontag-editor.tsxit solves the issue.It seems before we were sanitizing the tag in different ways, and that didn't work, but it's unclear how it may have worked years ago. For now this change seems to do the trick
Explored some alternatives, but going down the path of JSON.stringify'ing the argument elsewhere, or trying to sanitize it elsewhere, becomes a trap quickly and doesn't fully work.
Investigation details here
When using File template tags as value for environment variables in the JSON / non-table view of the Environment Editor, the file path gets stored with a bad path on the environment.
\\\\to\\\\- which then magically dissappears when attempting to use the Env variable in a request, so a string likeC:\\Users\\filipe\\Desktop\\test.txtends up asC:\UsersfilipeDesktoptest.txtAppData\Local\insomnia\app-10.2.0path to the full bad path.Closes INS-4742
Closes #5754