anonymousland-synapse/synapse/rest/media/v1
Tim Leung ddb240293a
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`](bdb941be42/Lib/urllib/request.py (L2519))
- Extract env variables using urllib's `getproxies`/[`getproxies_environment`](bdb941be42/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
2021-02-26 17:37:57 +00:00
..
__init__.py copyrights 2016-01-07 04:26:29 +00:00
_base.py Fix some typos. 2021-02-12 11:14:12 -05:00
config_resource.py Add type hints to media rest resources. (#9093) 2021-01-15 10:57:37 -05:00
download_resource.py Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
filepath.py Add type hints to media rest resources. (#9093) 2021-01-15 10:57:37 -05:00
media_repository.py Regenerate exact thumbnails if missing 2021-02-18 17:05:32 +00:00
media_storage.py Return a 404 if we don't have the original file 2021-02-19 10:46:18 +00:00
preview_url_resource.py Add support for no_proxy and case insensitive env variables (#9372) 2021-02-26 17:37:57 +00:00
storage_provider.py Add type hints to media rest resources. (#9093) 2021-01-15 10:57:37 -05:00
thumbnail_resource.py Return a 404 if we don't have the original file 2021-02-19 10:46:18 +00:00
thumbnailer.py Add type hints to media rest resources. (#9093) 2021-01-15 10:57:37 -05:00
upload_resource.py Add check_media_file_for_spam spam checker hook 2021-02-04 17:01:30 +00:00