mirror of
https://github.com/ihabunek/toot
synced 2025-01-09 00:03:15 +01:00
Apply requests environment settings
Allows use of enironment variables for setting proxies and trusted CAs. See: http://docs.python-requests.org/en/master/user/advanced/#prepared-requests
This commit is contained in:
parent
9d10ce22f1
commit
226713a5a0
@ -8,7 +8,8 @@ def send_request(request, allow_redirects=True):
|
||||
|
||||
with Session() as session:
|
||||
prepared = session.prepare_request(request)
|
||||
response = session.send(prepared, allow_redirects=allow_redirects)
|
||||
settings = session.merge_environment_settings(prepared.url, {}, None, None, None)
|
||||
response = session.send(prepared, allow_redirects=allow_redirects, **settings)
|
||||
|
||||
log_response(response)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user