]> git.ipfire.org Git - pbs.git/commitdiff
api: Don't show the download endpoints in the API schema
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 2 Jul 2025 18:33:59 +0000 (18:33 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 2 Jul 2025 18:33:59 +0000 (18:33 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/api/downloads.py

index 111044253dcb19e68d499ef6176a26d5737ed1a0..f6f7704331b68a20b067cdc9224ba4acff65f905 100644 (file)
@@ -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),