Spaces:
Paused
Paused
Update app.py
Browse files4 unmodified lines56789102 unmodified lines1314151617181920212223242526272829303132334 unmodified linesapp = FastAPI()@app.get("/")def home():return FileResponse("static/index.html")2 unmodified lines@app.get("/scan")async def scan():url = "https://stuartmods.xyz"async with httpx.AsyncClient(follow_redirects=True,timeout=15) as client:response = await client.get(url)headers = dict(response.headers)return {"status": response.status_code,"headers": headers,"server": headers.get("server"),"powered_by": headers.get("x-powered-by"),"cookies": headers.get("set-cookie")}4 unmodified lines56789101112132 unmodified lines1617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162634 unmodified linesapp = FastAPI()TARGET_URL = "https://stuartmods.xyz"@app.get("/")def home():return FileResponse("static/index.html")2 unmodified lines@app.get("/scan")async def scan():try:async with httpx.AsyncClient(follow_redirects=True,timeout=20) as client:response = await client.get(TARGET_URL)headers = dict(response.headers)return {"target": TARGET_URL,"status_code": response.status_code,"server": headers.get("server"),"powered_by": headers.get("x-powered-by"),"content_type": headers.get("content-type"),"cookies": headers.get("set-cookie"),"headers": headers}except Exception as e:return {"error": str(e)}
app.py+40-10