Verified Commit b54b7221 authored by SIMONIN Matthieu's avatar SIMONIN Matthieu
Browse files

Prepare request and merge settings from env

For instance, this ensures the proxy socks set with http_proxy is taken
into account
parent e8e3e911
Pipeline #90901 passed with stage
in 2 minutes and 23 seconds
......@@ -2,6 +2,7 @@ import json
import copy
import logging
import requests
from requests.adapters import HTTPAdapter
class Distem:
......@@ -875,7 +876,10 @@ class Distem:
req = requests.Request(method, route, data=_data)
prepped = req.prepare()
response = self.client.send(prepped)
# we merge with the environmental settings (e.g proxy)
settings = self.client.merge_environment_settings(
prepped.url, {}, None, False, None)
response = self.client.send(prepped, **settings)
if 200 <= response.status_code < 300:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment