summary refs log tree commit diff
path: root/changelog.d
diff options
context:
space:
mode:
authorTim Leung <tim95@hotmail.co.uk>2021-02-26 17:37:57 +0000
committerGitHub <noreply@github.com>2021-02-26 17:37:57 +0000
commitddb240293a3d7e0a903f322088e937d7e4f3de68 (patch)
treeb3b840433330217df6d031d97a962be73d482269 /changelog.d
parentSSO: redirect to public URL before setting cookies (#9436) (diff)
downloadsynapse-ddb240293a3d7e0a903f322088e937d7e4f3de68.tar.xz
Add support for no_proxy and case insensitive env variables (#9372)
### Changes proposed in this PR

- Add support for the `no_proxy` and `NO_PROXY` environment variables
  - Internally rely on urllib's [`proxy_bypass_environment`](https://github.com/python/cpython/blob/bdb941be423bde8b02a5695ccf51c303d6204bed/Lib/urllib/request.py#L2519)
- Extract env variables using urllib's `getproxies`/[`getproxies_environment`](https://github.com/python/cpython/blob/bdb941be423bde8b02a5695ccf51c303d6204bed/Lib/urllib/request.py#L2488) which supports lowercase + uppercase, preferring lowercase, except for `HTTP_PROXY` in a CGI environment

This does contain behaviour changes for consumers so making sure these are called out:
- `no_proxy`/`NO_PROXY` is now respected
- lowercase `https_proxy` is now allowed and taken over `HTTPS_PROXY`

Related to #9306 which also uses `ProxyAgent`

Signed-off-by: Timothy Leung tim95@hotmail.co.uk
Diffstat (limited to 'changelog.d')
-rw-r--r--changelog.d/9372.feature1
1 files changed, 1 insertions, 0 deletions
diff --git a/changelog.d/9372.feature b/changelog.d/9372.feature
new file mode 100644
index 0000000000..3cb01004c9
--- /dev/null
+++ b/changelog.d/9372.feature
@@ -0,0 +1 @@
+The `no_proxy` and `NO_PROXY` environment variables are now respected in proxied HTTP clients with the lowercase form taking precedence if both are present. Additionally, the lowercase `https_proxy` environment variable is now respected in proxied HTTP clients on top of existing support for the uppercase `HTTPS_PROXY` form and takes precedence if both are present. Contributed by Timothy Leung.