Update fun.py
Browse files
fun.py
CHANGED
@@ -10,6 +10,8 @@ print(f'RESP:{ resp.json}')
|
|
10 |
@app.api_route("/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"])
|
11 |
async def proxy(request: Request, path: str):
|
12 |
resp = httpx.get(TARGET_BASE)
|
|
|
|
|
13 |
print(f'RESP:{resp.json}')
|
14 |
# if path == "":
|
15 |
# # 拒绝根目录
|
|
|
10 |
@app.api_route("/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"])
|
11 |
async def proxy(request: Request, path: str):
|
12 |
resp = httpx.get(TARGET_BASE)
|
13 |
+
# 强制Host头为127.0.0.1
|
14 |
+
headers["host"] = "127.0.0.1"
|
15 |
print(f'RESP:{resp.json}')
|
16 |
# if path == "":
|
17 |
# # 拒绝根目录
|