Skip to content

Commit

Permalink
[File API] Validate string length in request (#8983)
Browse files Browse the repository at this point in the history
Description
---
Fixes issue from [monitor](https://dust4ai.slack.com/archives/C05F84CFP0E/p1732744057540389)

Risks
---
na

Deploy
---
front
  • Loading branch information
philipperolet authored and Henry Fontanier committed Nov 28, 2024
1 parent 0449c00 commit a16f4c6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sdks/js/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a16f4c6

Please sign in to comment.