Skip to content

Commit 5748e23

Browse files
committed
chore(webhooks): drop inline comments from capped body readers
1 parent e84b0c3 commit 5748e23

2 files changed

Lines changed: 0 additions & 6 deletions

File tree

apps/sim/app/api/webhooks/agentmail/route.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ const AGENTMAIL_BODY_LABEL = 'AgentMail webhook body'
4343
*/
4444
async 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,

apps/sim/lib/webhooks/processor.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)