Skip to content

fix: Fix header merging case-sensitivity issue - #1238

Merged
developerkunal merged 2 commits into
masterfrom
fern-bot/2025-11-04T12-18Z
Nov 6, 2025
Merged

fix: Fix header merging case-sensitivity issue#1238
developerkunal merged 2 commits into
masterfrom
fern-bot/2025-11-04T12-18Z

Conversation

@fern-api

@fern-api fern-api Bot commented Nov 4, 2025

Copy link
Copy Markdown
Contributor

Changes

This PR fixes a critical security issue with header merging:

Header Merging Security Fix (Fixes #1228)

  • Fixed case-sensitivity issue in header merging that could lead to duplicate or ambiguous headers
  • mergeHeaders and mergeOnlyDefinedHeaders now normalize header names to lowercase
  • Prevents security issues where attackers could override SDK-provided headers (e.g., Authorization) by using different casing
  • Ensures headers like Authorization and authorization are treated as the same header

Fern Auto-Generated Changes

  • This PR includes auto-generated code updates from Fern to match the latest API Definition
  • Updated form-urlencoded body serialization support
  • Added comprehensive test coverage for complex nested objects and arrays in form data
  • Dependency updates: @types/node, baseline-browser-mapping, caniuse-lite, graphql

References

Testing

  • This change adds unit test coverage
  • This change adds integration test coverage

Checklist

  • I have read the Auth0 general contribution guidelines
  • I have read the Auth0 Code of Conduct
  • All existing and new tests complete without errors

@fern-api
fern-api Bot requested a review from a team as a code owner November 4, 2025 12:18
@codecov

codecov Bot commented Nov 4, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.18256% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.94%. Comparing base (c98ea37) to head (f4cd203).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/management/core/headers.ts 66.66% 2 Missing ⚠️
...urces/jobs/resources/usersImports/client/Client.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1238      +/-   ##
==========================================
+ Coverage   79.56%   79.94%   +0.37%     
==========================================
  Files         515      515              
  Lines       18926    19287     +361     
  Branches     9056     9413     +357     
==========================================
+ Hits        15059    15419     +360     
- Misses       3867     3868       +1     
Flag Coverage Δ
alltests 79.94% <99.18%> (+0.37%) ⬆️

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.

@developerkunal developerkunal changed the title 🌿 Fern Regeneration -- November 4, 2025 feat: Add custom fetch support and fix header merging issue Nov 4, 2025
developerkunal
developerkunal previously approved these changes Nov 4, 2025

@developerkunal developerkunal 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.

LGTM

@developerkunal developerkunal changed the title feat: Add custom fetch support and fix header merging issue fix: Fix header merging case-sensitivity issue Nov 4, 2025
@developerkunal
developerkunal merged commit b10fdde into master Nov 6, 2025
10 checks passed
@developerkunal
developerkunal deleted the fern-bot/2025-11-04T12-18Z branch November 6, 2025 02:33
@developerkunal developerkunal mentioned this pull request Nov 6, 2025
harshithRai pushed a commit to tsushanth/node-auth0 that referenced this pull request Jul 16, 2026
Closes auth0#1330.

The internal fetcher layer added `BaseClientOptions.fetch?: typeof
fetch` in auth0#1238 and routes it through `fetcherImpl(args.fetchFn ??
…)`. The public wrapper, however, both omitted `fetch` from
`ManagementClientOptions` and explicitly deleted it from the incoming
options bag, so library consumers had no supported way to provide their
own HTTP transport — even though the SDK is already capable of using
one.

- Drop `"fetch"` from the `Omit<FernClient.Options, …>` list so the
  field is part of the public surface.
- Stop deleting `_options.fetch` in the `ManagementClient` constructor.
  The internal `fetcher` is still stripped (it's a Fern implementation
  detail), with a comment explaining why.

Adds a focused test in `tests/management/ManagementClient.test.ts` that
constructs a `ManagementClient` with a custom `fetch`, fires a request,
and asserts the custom implementation was invoked against the expected
URL. Also covers the no-`fetch` happy path to make sure the default
global-fetch route is unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Small header merging issue

3 participants