Spaces:
Sleeping
Sleeping
fix result dict reference bug (use update instead of reassign)
Browse files18 unmodified lines192021222223242524 unmodified lines5051525353545556575758596018 unmodified lines
rid = str(uuid.uuid4()) event = asyncio.Event() result = {} result = {"body": b"", "status": 502, "content_type": "text/plain"} pending[rid] = {"event": event, "result": result, "url": target_url, "claimed": False} try: await asyncio.wait_for(event.wait(), timeout=30)24 unmodified lines status = int(request.query.get("status", "200")) content_type = request.query.get("content_type", "text/html") body = await request.read() pending[rid]["result"] = { pending[rid]["result"].update({ "status": status, "content_type": content_type, "body": body } }) pending[rid]["event"].set() return web.json_response({"status": "ok"})
app.py+3-3