fix: harden residual route and restore checks

This commit is contained in:
jb
2026-09-19 10:01:23 -04:00
parent cb86497724
commit 01b8b4642b
7 changed files with 45 additions and 11 deletions
+3
View File
@@ -6,6 +6,9 @@ import { capabilityDisabledReason, capabilityEnabled } from '$lib/server/release
import { configuration } from '$lib/server/config';
export const POST: RequestHandler = async (event) => {
const config = configuration();
// Bound origin/session work by the existing anonymous IP bucket first. The
// normal authenticated user-keyed limiter is restored after resolution.
protectMutation(event, `sync:${event.getClientAddress()}`, 6);
if (!capabilityEnabled('asset_sync', config.capabilityAllowlist)) {
return json({ error: capabilityDisabledReason('asset_sync') }, { status: 503 });
}