Fix proxy
This commit is contained in:
parent
3aefaff818
commit
8613cc0206
2 changed files with 5 additions and 0 deletions
2
app.py
2
app.py
|
@ -4,6 +4,7 @@ import os
|
|||
import traceback
|
||||
from datetime import datetime
|
||||
from typing import Any
|
||||
from urllib.parse import urlparse
|
||||
from uuid import uuid4
|
||||
|
||||
import requests
|
||||
|
@ -242,6 +243,7 @@ def proxy(url: str) -> Any:
|
|||
for k, v in dict(request.headers).items()
|
||||
if k.lower() not in ["host", "cookie"]
|
||||
}
|
||||
req_headers["Host"] = urlparse(url).netloc
|
||||
resp = requests.get(url, stream=True, headers=req_headers)
|
||||
app.logger.info(f"proxied req {url}: {resp!r}")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue