mirror of
https://github.com/hanzomsg/nats-server.git
synced 2026-10-30 20:27:34 +00:00
The config parser allows for environment variables to reference
other environment variables. However, self references or cycles
would cause the parser to enter an infinite recursion.
This commit introduces cycle detection in the environment
variable lookup process, so that the parser handles cycles
and self-references gracefully.
A set of tests check that the current behavior of the parser
did not change:
- variables can reference other variables, as well
as environment variables
- environment variables can reference other
evironment variables, but not local variables
Fixes #7730
Signed-off-by: Daniele Sciascia <[email protected]>