From 9c7f06a57d7617febb2a3a27d57202e5a18bfd96 Mon Sep 17 00:00:00 2001 From: yuuki <> Date: Wed, 5 Mar 2025 08:02:18 +0000 Subject: [PATCH] limit=0 --- app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index b631899..f47e475 100644 --- a/app.py +++ b/app.py @@ -133,7 +133,7 @@ def fastapi_serve(dir: str, ref: str, indexes: List[str] = ["index.html", "index def get_ip(req: Request) -> str: return req.headers.get("CF-Connecting-IP") or req.headers.get("X-Forwarded-For") or req.client.host -def get_litey_notes(id: str = None, limit: int = -1) -> List[dict]: +def get_litey_notes(id: str = None, limit: int = 0) -> List[dict]: if not id: cursor = ctx["mongo_client"].litey.notes.find({}, { "_id": False }).sort("date", DESCENDING).limit(limit) return list(cursor) @@ -164,7 +164,7 @@ async def cors_handler(req: Request, call_next: Callable[[Request], Awaitable[Re return res @app.get("/api/litey/get") -async def api_get(id: str = None, limit: int = -1): +async def api_get(id: str = None, limit: int = 0): res = JSONResponse(get_litey_notes(id, limit)) res.headers["Cache-Control"] = f"public, max-age=60, s-maxage=60" res.headers["CDN-Cache-Control"] = f"max-age=60"