Regression: Double-{} wrapped VARS no longer resolved in scripts
I have checked the following:
- [X] I use the newest version of bruno.
- [X] I've searched existing issues and found nothing related to my issue.
Describe the bug
Where this came up: It was possible to extract a sub-string from the value saved in an environment dependent environmental variable (saved in the .env file).
Breakage:
Now if I use define a Pre Request Var in the VARS tab and load it in my Script:
const cookie = bru.getVar('Cookie');
then it is no longer resolved:
console.log({cookie});
returns {{cookie}}, where it used to return the value of the cookie env var, which I could work with in the script.
.bru file to reproduce the bug
const envvar1 = bru.getVar('ev1');
console.log({envvar1});
req.setHeader("test", envvar1); console.log(req.headers);
Screenshots/Live demo link
That works for me unless I am missing something.
https://github.com/usebruno/bruno/assets/139650490/d9002275-a9bb-41f2-834d-b160e8bb96e3
@busy-panda What you tried misses the part that broke: The requests Vars can refer to environmental variables. Those are not resolved any more.
https://github.com/usebruno/bruno/assets/36134546/b69b2445-bc09-42c1-9f09-97d6a684b32d
I am checking, but why you don't retrieve directly from environment variable, instead of retrieve a variable that retrieve an environment variable ?
It's working now, when the PR is merged. Cheers.
Closing this because the PR implementing the fix has already been merged.