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
enable requests.Session.trust_env on default #648
Conversation
@ksauzz Just to confirm, this is working as expected for the MPContribs client, right? |
@tschaume Yes, it works as expected. In my understanding this session object isn't shared with mpcontribs-client since mpcontribs-client use HTTP(S)_PROXY env without this change. Additionally according to the code it looks mpcontribs-client creates another session object here. FuturesSession's constructor can take session keyword arg, but nothing is here. My pytest's result is the following: run tests w/o a proxy
run tests w/ a proxy
how to run squid as a http proxy for materialsproject.org
tail access logs
|
Thank you all!! BTW, I'm sorry for my wrong the PR's title and description. I wrote I'm going to fix them. |
Summary
DisableEnablerequests.Session.trust_env
on default to use HTTP_PROXY/HTTPS_PROXY env and avoid unexpected behavior.Please let me know if any specific reason exists to need
requests.Session.trust_env=true
requests.Session.trust_env=False
on default.see: requests.Session.trust_env
Background
We have an application running behind a HTTP proxy using HTTP_PROXY and HTTPS_PROXY env because of security purpose. We tried to use mp-api, then we observed the client use the proxy for
contribs-api.materialsproject.org
endpoint, but doesn't use the proxy forapi.materialsproject.org
. After the investigation, we foundrequests.Session.trus_env=False
ignore the environment variables of proxy servers.Contributor Checklist
requests.Session.trus_env
on default