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

HttpVHost::addRailsApp system default env can override custom env #409

Open
climatebrad opened this issue Aug 4, 2024 · 1 comment
Open

Comments

@climatebrad
Copy link

As written, the HttpVHost::addRailsApp function attaches the environment variables defined by pAppDefault->getEnv after the ones set by the options it's called with (and the ones it sets internally), which can cause failures in programs like RackRunner.rb to respect the custom environment. In particular, pAppDefault will have PATH set which will override any custom path set in a Virtual Host context, if I'm getting this right.

config.getEnv()->add(pAppDefault->getEnv());

could be replaced with something like

Env *pDefaultEnv = pAppDefault->getEnv();
if (pDefaultEnv)
{
    for (const auto &var : *pDefaultEnv)
    {
        config.addEnvIfNotExist(var.c_str(), var.c_str());
    }
}
@litespeedtech
Copy link
Owner

It will be fixed in 1.8.2 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants