Skip to content

fix(issue): Handle object headers in buildRequestMarkdown - #1441

Merged
BYK merged 1 commit into
mainfrom
seer/fix/cli-297-object-headers
Aug 19, 2026
Merged

fix(issue): Handle object headers in buildRequestMarkdown#1441
BYK merged 1 commit into
mainfrom
seer/fix/cli-297-object-headers

Conversation

@sentry

@sentry sentry Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

The buildRequestMarkdown function in src/lib/formatters/human.ts expected data.headers to be an iterable array of [key, value] tuples. However, the Sentry API can return headers as a plain Record<string, string> object, leading to a TypeError: .for is not iterable when attempting to iterate over it.

This fix addresses the issue by:

  1. Widening the headers type in RequestEntry (src/types/sentry.ts) to include Record<string, string> as a possible shape, aligning with the actual API response.
  2. Normalizing data.headers to an iterable array using Array.isArray(data.headers) ? data.headers : Object.entries(data.headers) before iterating in buildRequestMarkdown. This ensures the for...of loop always receives an iterable, preventing the TypeError.

Fixes CLI-297

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
cli Ready Ready Preview Aug 19, 2026 10:43am

Request Review

@BYK
BYK merged commit 92e2d64 into main Aug 19, 2026
29 checks passed
@BYK
BYK deleted the seer/fix/cli-297-object-headers branch August 19, 2026 11:14
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