feat: cap custom CSS length and add validation tests

Bound customCSS to 100000 characters on both the client schema and the
server body validation (the server is the enforcement boundary; multer's
1MB field cap was the only limit), regenerate the OpenAPI spec, and add
a validation test suite covering acceptance, clearing, the length cap,
and type rejection.
This commit is contained in:
Buco7854 committed 2026-06-10 17:02:17 +02:00
1 parent 73f95ac8e1
commit 0f4240d3db
4 files changed
+61 -4

No files matched your search

@@ -32,7 +32,7 @@ export const createStatusPageBodyValidation = z
showUptimePercentage: booleanCoercion,
showAdminLoginLink: booleanCoercion.optional(),
showInfrastructure: booleanCoercion.optional(),
customCSS: z.string().optional(),
customCSS: z.string().max(100000, "Custom CSS must be at most 100000 characters").optional(),
removeLogo: z.union([z.literal("true"), z.literal("false")]).optional(),
theme: z.enum(StatusPageThemes).optional(),
themeMode: z.enum(StatusPageThemeModes).optional(),