litespeedtech / litespeedtech/openlitespeed
HttpVHost::addRailsApp system default env can override custom env
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.5k
- Forks
- 233
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 5
Description
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.
https://github.com/litespeedtech/openlitespeed/blob/d9610258f5c76ca204e1fd7074c23297b96a64de/src/http/httpvhost.cpp#L1712
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());
}
}
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/http/httpvhost.cpp around line 1712 and trace how HttpVHost::addRailsApp combines default, option-provided, and internal environment variables. Verify the precedence for PATH and other custom variables, then confirm that defaults fill only variables not already configured. Done means a Virtual Host’s custom environment is preserved while system defaults remain available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100