mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Apply tls_verify and tls_cacerts to ImageDownloader (#11716)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
This commit is contained in:
parent
db9e476288
commit
2d1b94361f
@ -50,6 +50,9 @@ Bugs fixed
|
||||
* #11675: Fix rendering of progression bars in environments that do not support
|
||||
ANSI control sequences.
|
||||
Patch by Bénédikt Tran.
|
||||
* #11715: Apply ``tls_verify`` and ``tls_cacerts`` config to
|
||||
``ImageDownloader``.
|
||||
Patch by Nick Touran.
|
||||
|
||||
Testing
|
||||
-------
|
||||
|
@ -75,7 +75,12 @@ class ImageDownloader(BaseImageConverter):
|
||||
timestamp: float = ceil(os.stat(path).st_mtime)
|
||||
headers['If-Modified-Since'] = epoch_to_rfc1123(timestamp)
|
||||
|
||||
r = requests.get(node['uri'], headers=headers)
|
||||
config = self.app.config
|
||||
r = requests.get(
|
||||
node['uri'], headers=headers,
|
||||
_user_agent=config.user_agent,
|
||||
_tls_info=(config.tls_verify, config.tls_cacerts),
|
||||
)
|
||||
if r.status_code >= 400:
|
||||
logger.warning(__('Could not fetch remote image: %s [%d]') %
|
||||
(node['uri'], r.status_code))
|
||||
|
Loading…
Reference in New Issue
Block a user