Skip to content

Commit

Permalink
chore: add leeway to max body length
Browse files Browse the repository at this point in the history
  • Loading branch information
javiersuweijie committed Oct 24, 2024
1 parent cf318d5 commit f712d0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/app/src/app/submit/email/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function processEmail(values: z.infer<typeof formSchema>, email: st
}
headerString = result.headers.toString();
const headerLength = result.headers.length;
const maxHeaderLength = Math.ceil(headerLength / 64) * 64;
const maxHeaderLength = (Math.ceil(headerLength / 64) + 2) * 64;
const domain = result.signingDomain;
const selector = result.selector;
res = {
Expand Down Expand Up @@ -65,7 +65,7 @@ export async function processEmail(values: z.infer<typeof formSchema>, email: st
}
splitBodyString = split[1];
}
const maxBodyLength = Math.ceil(splitBodyString.length / 64) * 64;
const maxBodyLength = (Math.ceil(splitBodyString.length / 64) + 2) * 64;
res = {
...res,
maxBodyLength,
Expand Down

0 comments on commit f712d0e

Please sign in to comment.