From d7d3a0858de4107f8f81dc66c8fd1ba7daa519c9 Mon Sep 17 00:00:00 2001 From: Philippe Rolet Date: Thu, 28 Nov 2024 11:22:26 +0100 Subject: [PATCH] [File API] Validate string length in request (#8983) Description --- Fixes issue from [monitor](https://dust4ai.slack.com/archives/C05F84CFP0E/p1732744057540389) Risks --- na Deploy --- front --- sdks/js/src/types.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sdks/js/src/types.ts b/sdks/js/src/types.ts index 4becf3f3abd3..da65ac450d10 100644 --- a/sdks/js/src/types.ts +++ b/sdks/js/src/types.ts @@ -2092,8 +2092,10 @@ export type GetWorkspaceUsageRequestType = z.infer< >; export const FileUploadUrlRequestSchema = z.object({ - contentType: z.string(), - fileName: z.string(), + contentType: z + .string() + .max(256, "Content type must be less than 256 characters"), + fileName: z.string().max(256, "File name must be less than 256 characters"), fileSize: z.number(), useCase: z.union([z.literal("conversation"), z.literal("avatar")]), useCaseMetadata: z