Skip to content

Commit 7af5c18

Browse files
committed
reject promise correctly
1 parent bcf65aa commit 7af5c18

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

apps/sim/lib/core/security/input-validation.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,11 @@ export function secureFetchWithPinnedIP(
988988
const chunks: Buffer[] = []
989989

990990
res.on('data', (chunk: Buffer) => chunks.push(chunk))
991+
992+
res.on('error', (error) => {
993+
reject(error)
994+
})
995+
991996
res.on('end', () => {
992997
const bodyBuffer = Buffer.concat(chunks)
993998
const body = bodyBuffer.toString('utf-8')

0 commit comments

Comments
 (0)