Update fun.py
Browse files
fun.py
CHANGED
@@ -19,7 +19,7 @@ logger = logging.getLogger(__name__)
|
|
19 |
async def proxy(request: Request, path: str):
|
20 |
url = f"{TARGET_BASE}/{path}"
|
21 |
headers = dict(request.headers)
|
22 |
-
|
23 |
body = await request.body()
|
24 |
async with httpx.AsyncClient(follow_redirects=True) as client:
|
25 |
resp = await client.request(
|
|
|
19 |
async def proxy(request: Request, path: str):
|
20 |
url = f"{TARGET_BASE}/{path}"
|
21 |
headers = dict(request.headers)
|
22 |
+
headers["host"] = "127.0.0.1" # 强制修改 Host 头
|
23 |
body = await request.body()
|
24 |
async with httpx.AsyncClient(follow_redirects=True) as client:
|
25 |
resp = await client.request(
|