fix(certificates): improve validation and prevent crash (#2910)

This commit is contained in:
Meier Lukas
2025-04-22 18:28:58 +02:00
committed by GitHub
parent 3172e6e0c4
commit c51424717d
5 changed files with 72 additions and 24 deletions

View File

@@ -24,7 +24,7 @@ export const superRefineCertificateFile = (value: File | null, context: z.Refine
});
}
if (value.type !== "application/x-x509-ca-cert" && value.type !== "application/pkix-cert") {
if (!value.name.endsWith(".crt") && !value.name.endsWith(".pem")) {
return context.addIssue({
code: "custom",
params: createCustomErrorParams({