Skip to content

fix(cli): Reject custom header values that fetch cannot send - #1604

Merged
BYK merged 1 commit into
mainfrom
fix/cli-custom-header-values
Oct 23, 2026
Merged

BYK merged 1 commit into
mainfrom
fix/cli-custom-header-values

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

A custom header value with emoji, other non-Latin-1 characters, CR, LF, or NUL made undici's Headers.set() throw an opaque TypeError: Cannot convert argument to a ByteString at request time (CLI-31G).

Values from SENTRY_CUSTOM_HEADERS and SentryOptions.headers are now validated up front and rejected with a ConfigError that names the header but never echoes its value, since these headers often carry proxy credentials.

The e2e redaction test used a CR in a header to reach the unexpected-error path. It now asserts the config error instead; redaction of unexpected errors stays covered by the unit tests.

Ported from getsentry/cli#1660, which is being closed with the repo archive.

via BYK.

--

View Junior Session in Sentry

A custom header value with emoji, other non-Latin-1 characters, CR, LF,
or NUL made undici's Headers.set() throw an opaque TypeError at request
time (CLI-31G). Validate values from SENTRY_CUSTOM_HEADERS and
SentryOptions.headers up front and throw a ConfigError that names the
header without echoing its value.

Ported from getsentry/cli#1660.

Co-Authored-By: BYK <[email protected]>
@vercel

vercel Bot commented Oct 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Oct 22, 2026 6:30pm UTC

Request Review

@BYK
BYK merged commit b7e0366 into main Oct 23, 2026
32 of 34 checks passed
@BYK
BYK deleted the fix/cli-custom-header-values branch October 23, 2026 11:16

This branch was previously deployed

1 inactive deployment
Preview — b443da4a Deployed Oct 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant