From: Michael Tremer Date: Wed, 2 Jul 2025 18:33:59 +0000 (+0000) Subject: api: Don't show the download endpoints in the API schema X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b82286e22d52a636118eec80779833f2ddd5a3f;p=pbs.git api: Don't show the download endpoints in the API schema Signed-off-by: Michael Tremer --- diff --git a/src/api/downloads.py b/src/api/downloads.py index 11104425..f6f77043 100644 --- a/src/api/downloads.py +++ b/src/api/downloads.py @@ -33,7 +33,7 @@ router = fastapi.APIRouter( # XXX These endpoints need some ratelimiting applied -@router.head("/{path:path}") +@router.head("/{path:path}", include_in_schema=False) async def head(path: str) -> fastapi.Response: """ Handle any HEAD requests @@ -64,7 +64,7 @@ async def get_current_address( return ipaddress.ip_address(request.client.host) -@router.get("/{path:path}") +@router.get("/{path:path}", include_in_schema=False) async def get( path: str, current_address: ipaddress.IPv6Address | ipaddress.IPv4Address = \ fastapi.Depends(get_current_address),