fix(users): profile picture upload limit wrong (#4276)
This commit is contained in:
@@ -114,11 +114,10 @@ export const userRouter = createTRPCRouter({
|
|||||||
.input(
|
.input(
|
||||||
z.object({
|
z.object({
|
||||||
userId: z.string(),
|
userId: z.string(),
|
||||||
// Max image size of 256KB, only png and jpeg are allowed
|
|
||||||
image: z
|
image: z
|
||||||
.string()
|
.string()
|
||||||
.regex(/^data:image\/(png|jpeg|gif|webp);base64,[A-Za-z0-9/+]+=*$/g)
|
.regex(/^data:image\/(png|jpeg|gif|webp);base64,[A-Za-z0-9/+]+=*$/g)
|
||||||
.max(262144)
|
.max(350000) // approximately 256KB in base64 (256 * 1024 * 4 / 3 + prefixes)
|
||||||
.nullable(),
|
.nullable(),
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user