Skip to content

fix: reassign HttpHeaders after delete in Angular client#3988

Merged
mrlubos merged 4 commits into
hey-api:mainfrom
joshkaplinsky:fix/angular-http-headers-immutable
Jun 8, 2026
Merged

fix: reassign HttpHeaders after delete in Angular client#3988
mrlubos merged 4 commits into
hey-api:mainfrom
joshkaplinsky:fix/angular-http-headers-immutable

Conversation

@joshkaplinsky

Copy link
Copy Markdown
Contributor

Angular's HttpHeaders is immutable, .delete() returns a new instance with the header removed rather than mutating in place. The result was not being reassigned to opts.headers, so Content-Type was silently never removed on bodyless requests.

Fixes #3987.

  • Reassign opts.headers = opts.headers.delete('Content-Type') in the Angular client gen

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

@joshkaplinsky is attempting to deploy a commit to the Hey API Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Jun 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 35dd206

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hey-api/openapi-ts Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 3, 2026
@joshkaplinsky joshkaplinsky changed the title fix: reassign HttpHeaders after delete in Angular client fix: reassign HttpHeaders after delete in Angular client Jun 3, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed changes — fixes a subtle immutability bug in the Angular client where HttpHeaders.delete() was called without capturing its return value, silently leaving Content-Type present on bodyless requests.

  • Reassign opts.headers = opts.headers.delete('Content-Type') in client-angular to respect Angular's immutable HttpHeaders.
  • Regenerate all affected test snapshots across OpenAPI 2.0.x / 3.0.x / 3.1.x and both plugins/clients paths.
  • Add changeset for @hey-api/openapi-ts patch release.

Pullfrog  | View workflow run | Using Kimi K2𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed changes — fixes a subtle immutability bug in the Angular client where HttpHeaders.delete() was called without capturing its return value, silently leaving Content-Type present on bodyless requests.

  • Reassign opts.headers = opts.headers.delete('Content-Type') in client-angular to respect Angular's immutable HttpHeaders.
  • Regenerate all affected test snapshots across OpenAPI 2.0.x / 3.0.x / 3.1.x and both plugins/clients paths.
  • Add changeset for @hey-api/openapi-ts patch release.

Pullfrog  | View workflow run | Using Kimi K2𝕏

@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.21%. Comparing base (82e9f18) to head (53ff1d4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3988   +/-   ##
=======================================
  Coverage   39.21%   39.21%           
=======================================
  Files         607      607           
  Lines       21468    21468           
  Branches     6345     6331   -14     
=======================================
  Hits         8418     8418           
  Misses      10626    10626           
  Partials     2424     2424           
Flag Coverage Δ
unittests 39.21% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jun 3, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jun 3, 2026

Copy link
Copy Markdown

Open in StackBlitz

@hey-api/codegen-core

npm i https://pkg.pr.new/@hey-api/codegen-core@3988

@hey-api/json-schema-ref-parser

npm i https://pkg.pr.new/@hey-api/json-schema-ref-parser@3988

@hey-api/nuxt

npm i https://pkg.pr.new/@hey-api/nuxt@3988

@hey-api/openapi-ts

npm i https://pkg.pr.new/@hey-api/openapi-ts@3988

@hey-api/shared

npm i https://pkg.pr.new/@hey-api/shared@3988

@hey-api/spec-types

npm i https://pkg.pr.new/@hey-api/spec-types@3988

@hey-api/types

npm i https://pkg.pr.new/@hey-api/types@3988

@hey-api/vite-plugin

npm i https://pkg.pr.new/@hey-api/vite-plugin@3988

commit: 35dd206

@mrlubos mrlubos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshkaplinsky good catch – thank you!

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jun 8, 2026
@mrlubos mrlubos merged commit 4c0d0f4 into hey-api:main Jun 8, 2026
7 of 9 checks passed
@hey-api hey-api Bot mentioned this pull request Jun 8, 2026
@joshkaplinsky joshkaplinsky deleted the fix/angular-http-headers-immutable branch June 8, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Angular Client Content-Type header not stripped on bodyless requests

2 participants