Skip to content

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

Open
@climatebrad

Description

@climatebrad

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());
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions