fixed / route

This commit is contained in:
Mathieu Broillet 2025-08-25 18:40:44 +02:00
parent 66ebe05908
commit 23accbfe1e
Signed by: mathieub
GPG Key ID: 4428608CDA3A98D3

View File

@ -209,11 +209,15 @@ async def fake_claim_exchange(request: Request, _=host_required([Hosts.PLEX])):
async def favicon():
return FileResponse("favicon.ico")
@app.get("/proxy")
async def hack():
return {"status": "ok"}
@app.api_route("/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"])
async def catch_all(request: Request, path: str):
if path == "":
return {"status": "PROXY ONLINE"}
if request.base_url.hostname in ["127.0.0.1", "localhost", "0.0.0.0"]:
return {"status": "proxy running ok"}
upstream_response = await call_official(request, path)