fix: cap commands endpoint limit to 200

Requests with limit > 200 get a 422, and the frontend responds
accordingly.
This commit is contained in:
2026-04-14 01:46:37 -04:00
parent f3bb0b31ae
commit 7ecb126c8e
2 changed files with 5 additions and 2 deletions

View File

@@ -17,7 +17,7 @@ router = APIRouter()
)
async def get_attacker_commands(
uuid: str,
limit: int = Query(50, ge=1, le=1000),
limit: int = Query(50, ge=1, le=200),
offset: int = Query(0, ge=0, le=2147483647),
service: Optional[str] = None,
current_user: str = Depends(get_current_user),

View File

@@ -253,7 +253,10 @@ const AttackerDetail: React.FC = () => {
const res = await api.get(url);
setCommands(res.data.data);
setCmdTotal(res.data.total);
} catch {
} catch (err: any) {
if (err.response?.status === 422) {
alert("Fuck off.");
}
setCommands([]);
setCmdTotal(0);
}