From 5155e64b10d6d556b94523366024d7971ab6860a Mon Sep 17 00:00:00 2001 From: stringsplit <77242831+nbitzz@users.noreply.github.com> Date: Wed, 1 May 2024 00:03:57 -0700 Subject: [PATCH] i think thats probably etter actually. --- src/server/lib/schemas/files.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/lib/schemas/files.ts b/src/server/lib/schemas/files.ts index cd23dcf..453e2ac 100644 --- a/src/server/lib/schemas/files.ts +++ b/src/server/lib/schemas/files.ts @@ -1,7 +1,10 @@ import {z} from "zod" import config from "../config.js" -export const FileId = z.string().regex(/[A-Za-z0-9_\-\.\!\=\:\&\$\,\+\;\@\~\*\(\)\']+/).max(config.maxUploadIdLength) +export const FileId = z.string() + .regex(/[A-Za-z0-9_\-\.\!\=\:\&\$\,\+\;\@\~\*\(\)\']+/,"file ID uses invalid characters") + .max(config.maxUploadIdLength,"file ID too long") + .min(1, "you... *need* a file ID") export const FileVisibility = z.enum(["public", "anonymous", "private"]) export const FileTag = z.string().toLowerCase().max(30, "tag length too long") export const FilePointer = z.object({