Spaces:
BG5
/
Running

BG5 commited on
Commit
e4e2ab1
·
verified ·
1 Parent(s): 118fcbf

Update fun.py

Browse files
Files changed (1) hide show
  1. fun.py +2 -0
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
  # # 拒绝根目录