File tree Expand file tree Collapse file tree
app/api/webhooks/agentmail Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,9 +43,6 @@ const AGENTMAIL_BODY_LABEL = 'AgentMail webhook body'
4343 */
4444async function readAgentMailBody ( req : Request ) : Promise < string > {
4545 assertContentLengthWithinLimit ( req . headers , WEBHOOK_MAX_BODY_BYTES , AGENTMAIL_BODY_LABEL )
46- // `readStreamToBufferWithLimit` returns an empty buffer for a null body, so a
47- // single capped read covers the empty-body case without an uncapped `.text()`
48- // fallback that could bypass the limit.
4946 const buffer = await readStreamToBufferWithLimit ( req . body , {
5047 maxBytes : WEBHOOK_MAX_BODY_BYTES ,
5148 label : AGENTMAIL_BODY_LABEL ,
Original file line number Diff line number Diff line change @@ -87,9 +87,6 @@ export async function parseWebhookBody(
8787 try {
8888 assertContentLengthWithinLimit ( request . headers , WEBHOOK_MAX_BODY_BYTES , WEBHOOK_BODY_LABEL )
8989
90- // `readStreamToBufferWithLimit` returns an empty buffer for a null body, so
91- // this single capped read covers the empty-body case too — no branch or
92- // redundant clone, and no uncapped `.text()` fallback to bypass.
9390 const buffer = await readStreamToBufferWithLimit ( request . clone ( ) . body , {
9491 maxBytes : WEBHOOK_MAX_BODY_BYTES ,
9592 label : WEBHOOK_BODY_LABEL ,
You can’t perform that action at this time.
0 commit comments