Explicitly use proxy
This commit is contained in:
parent
390488558e
commit
94e12af103
1 changed files with 5 additions and 1 deletions
|
@ -52,6 +52,9 @@ app = fastapi.FastAPI(
|
|||
root_path=os.environ.get("PREVIEW_ROOT_PATH", ""),
|
||||
lifespan=startup
|
||||
)
|
||||
proxy = os.getenv("PREVIEW_PROXY")
|
||||
if proxy:
|
||||
logging.debug("Using proxy: %r", proxy)
|
||||
lock = Lock()
|
||||
# noinspection PyTypeChecker
|
||||
app.add_middleware(
|
||||
|
@ -259,7 +262,8 @@ def preview_url(
|
|||
},
|
||||
timeout=60,
|
||||
follow_redirects=False,
|
||||
trust_env=True # for HTTP[S]/ALL_PROXY environment variables.
|
||||
trust_env=True, # for HTTP[S]/ALL_PROXY environment variables.
|
||||
proxy=proxy
|
||||
) as client:
|
||||
try:
|
||||
response = client.get(
|
||||
|
|
Loading…
Reference in a new issue