Skip to content

Commit 254e593

Browse files
committed
fix: validate DSN before file I/O in send-envelope
Calling buildEnvelopeUrl(dsn) before the file read loop ensures invalid DSNs are caught upfront rather than after unnecessary I/O, consistent with send-event's behavior.
1 parent da503bb commit 254e593

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/commands/send-envelope.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { parseEnvelope, serializeEnvelope } from "@sentry/core";
1414
import type { SentryContext } from "../context.js";
1515
import { buildCommand } from "../lib/command.js";
1616
import {
17+
buildEnvelopeUrl,
1718
readFileBytes,
1819
requireDsn,
1920
sendEnvelopeRequest,
@@ -96,6 +97,8 @@ sentry send-envelope ./a.envelope ./b.envelope
9697
}
9798

9899
const dsn = requireDsn(flags, this.cwd);
100+
// Validate the DSN fully before doing any file I/O
101+
buildEnvelopeUrl(dsn);
99102

100103
for (const file of files) {
101104
let body: string | Uint8Array;

0 commit comments

Comments
 (0)