Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: Double-{} wrapped VARS no longer resolved in scripts #2134

Open
2 tasks done
mrhrzg opened this issue Apr 19, 2024 · 4 comments · May be fixed by #2213
Open
2 tasks done

Regression: Double-{} wrapped VARS no longer resolved in scripts #2134

mrhrzg opened this issue Apr 19, 2024 · 4 comments · May be fixed by #2213
Labels
bug Something isn't working

Comments

@mrhrzg
Copy link

mrhrzg commented Apr 19, 2024

I have checked the following:

  • I use the newest version of bruno.
  • 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

Screenshot 2024-04-19 at 12 02 01

@mrhrzg mrhrzg added the bug Something isn't working label Apr 19, 2024
@busy-panda
Copy link
Contributor

busy-panda commented Apr 25, 2024

That works for me unless I am missing something.

electron_tEcZkpzvQj.mp4

@mrhrzg
Copy link
Author

mrhrzg commented Apr 26, 2024

@busy-panda What you tried misses the part that broke: The requests Vars can refer to environmental variables. Those are not resolved any more.

bruno_unresolved_env_var.mp4
image

@busy-panda
Copy link
Contributor

I am checking, but why you don't retrieve directly from environment variable, instead of retrieve a variable that retrieve an environment variable ?

@busy-panda
Copy link
Contributor

It's working now, when the PR is merged.
Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants