Skip to content

Substring Environment Variables Overwrite Others #118

@bwolfe

Description

@bwolfe

Seems that env vars that are substrings of a subsequent env var are overwriting the later variable.

If I use this in my tests:
env_to_nginx("COOKIE_SECRET=secret", "COOKIE_SECRET_ALT=alt");
then the "COOKIE_SECRET_ALT" value is "secret" in the code.

If I reverse the order to:
env_to_nginx("COOKIE_SECRET_ALT=alt", "COOKIE_SECRET=secret");
then it works as expected in the code. (So I do have a workaround, this is a minor inconvenience that wasted a few hours of my day)

This also happens if I put them as "env" directives in a main_config override section of the test.

This does NOT happen outside of tests when running the app. The env vars can be in any order and still work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions