-
Notifications
You must be signed in to change notification settings - Fork 12
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
Use putenv() in InitialisationMiddleware #61
Use putenv() in InitialisationMiddleware #61
Conversation
I assume the tests are failing since |
Yeah, it looks like the testConfigureEgressProxyDomainExclusions fails on re-setting the environment, because it's not using the |
You could maybe |
That wouldn't actually resolve the issue. If we use Environment::setEnv() with a key, there will always be a key in |
Do we need to add this to the CWP upgrading guide? |
It's technically a regression - I think we'll retarget this at 2.0 and merge it up so future releases will configure the proxy automatically. For now though we have the External HTTP requests with proxy docs for configuring this, and our supported modules implement the proxy explicitly when using Guzzle for example. @indygriffiths previously removed the mention of auto-configured cURL requests in silverstripe/cwp#171. I'd like to get this in as soon as CWP 2.2.2 is released. |
…e request in InitialisationMiddleWare.
…y, https_proxy and NO_PROXY in InitialisationMiddleware to allow curl via exec() as per documentation.
…vironment::setEnv to test behaviour.
d278a74
to
03f32c8
Compare
This commit it based on changing the order of execution in InitialisationMiddleware.
It proposes to change the setting of the environment variables for
http_proxy
,https_proxy
andNO_PROXY
fromEnvironment::setEnv()
back toputenv()
as it was in CWP1.As described in the documentation of InitialisationMiddleware its main purpose is to configure the proxy so it is automatically picked up when calling
curl
in an apache context.I'm aware of the multithreaded issue described in laravel/framework#7354, but considering that these variables should be present anyway, I don't consider that to be an issue in context of CWP. Maybe @tractorcow has some insights into that?
Otherwise the variables are redundant as
SS_OUTBOUND_PROXY
,SS_OUTBOUND_PROXY_PORT
andNO_PROXY
already exist.