Skip to content

Conversation

@davideast
Copy link
Owner

Replaces unsafe type casting of req.headers with a convertHeaders helper function that correctly handles string[] and undefined values, converting them to a standard Fetch API Headers object.

  • Adds convertHeaders utility to src/utils/helpers/request.ts
  • Updates src/routing/server.ts to use convertHeaders
  • Adds unit tests for header conversion logic in tests/unit/request.helper.test.ts

Replaces unsafe type casting of `req.headers` with a `convertHeaders` helper function that correctly handles `string[]` and `undefined` values, converting them to a standard Fetch API `Headers` object.

* Adds `convertHeaders` utility to `src/utils/helpers/request.ts`
* Updates `src/routing/server.ts` to use `convertHeaders`
* Adds unit tests for header conversion logic in `tests/unit/request.helper.test.ts`
@davideast davideast merged commit 3dec96e into main Dec 12, 2025
1 check passed
@davideast davideast deleted the fix-header-types-3603717376694711578 branch December 12, 2025 14:51
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.

2 participants