mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Fix crash with invalid nip98 base64
This commit is contained in:
parent
4e68e3868f
commit
fb9bb284db
1 changed files with 1 additions and 1 deletions
|
|
@ -90,7 +90,7 @@ const decode64Schema = z.string().transform((value, ctx) => {
|
||||||
const bytes = Uint8Array.from(binString, (m) => m.codePointAt(0)!);
|
const bytes = Uint8Array.from(binString, (m) => m.codePointAt(0)!);
|
||||||
return new TextDecoder().decode(bytes);
|
return new TextDecoder().decode(bytes);
|
||||||
} catch (_e) {
|
} catch (_e) {
|
||||||
ctx.addIssue({ code: z.ZodIssueCode.custom, message: 'Invalid base64' });
|
ctx.addIssue({ code: z.ZodIssueCode.custom, message: 'Invalid base64', fatal: true });
|
||||||
return z.NEVER;
|
return z.NEVER;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue