mirror of
https://github.com/morluto/rea.git
synced 2026-11-11 01:13:39 +00:00
fix(domain): reject malformed base64 before byte-range checks
This commit is contained in:
1 parent
21f9af9d93
commit
31dc035041
7 files changed
+76
-90
No files matched your search
@@ -32,10 +32,13 @@ const paddedBase64SchemaRules = [
|
||||
{ not: { pattern: INVALID_BASE64_PADDING_PATTERN.source } },
|
||||
];
|
||||
|
||||
/** Canonical padded base64 with zero pad bits, including the empty encoding. */
|
||||
/** Canonical padded base64 with zero pad bits; invalid bytes never enter enclosing range checks. */
|
||||
export const canonicalBase64Schema = z
|
||||
.string()
|
||||
.refine(isCanonicalBase64, "Expected canonical padded base64")
|
||||
.refine(isCanonicalBase64, {
|
||||
message: "Expected canonical padded base64",
|
||||
abort: true,
|
||||
})
|
||||
.meta({
|
||||
allOf: [
|
||||
...paddedBase64SchemaRules,
|
||||
|
||||
Reference in new issue
Block a user