Skip to content

Conversation

@schickling
Copy link
Contributor

Summary

Added comprehensive JSDoc documentation to HttpMiddleware.cors explaining the subtle but important behavior of the allowedHeaders option: when empty array (default), it reflects back the client's Access-Control-Request-Headers (permissive), and when non-empty array, only specified headers are allowed (restrictive).

Test plan

  • Type checking passes
  • Linting passes
  • Documentation examples are accurate and follow the project style

Fixes #5935

Add comprehensive JSDoc documentation to HttpMiddleware.cors explaining
the important but subtle behavior of the allowedHeaders option:

- When empty array (default): reflects client's Access-Control-Request-Headers
  (permissive - allows all headers)
- When non-empty array: only allows specified headers (restrictive)

This clarifies the default behavior which was previously undocumented and
could lead to confusion when working with CORS requests, especially for
tracing headers like traceparent and b3.

Includes practical examples showing different usage patterns.

Fixes #5935

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@github-project-automation github-project-automation bot moved this to Discussion Ongoing in PR Backlog Dec 28, 2025
@changeset-bot
Copy link

changeset-bot bot commented Dec 28, 2025

🦋 Changeset detected

Latest commit: 2ea374c

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

This PR includes changesets to release 31 packages
Name Type
@effect/platform Patch
@effect/cli Patch
@effect/cluster Patch
@effect/experimental Patch
@effect/opentelemetry Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/rpc Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-drizzle Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-node Patch
@effect/sql Patch
@effect/workflow Patch
@effect/ai Patch
@effect/ai-amazon-bedrock Patch
@effect/ai-anthropic Patch
@effect/ai-google Patch
@effect/ai-openai Patch
@effect/ai-openrouter Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/sql-kysely 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

@tim-smart tim-smart merged commit 65e9e35 into main Dec 29, 2025
11 checks passed
@tim-smart tim-smart deleted the schickling/document-cors-headers branch December 29, 2025 03:04
@github-project-automation github-project-automation bot moved this from Discussion Ongoing to Done in PR Backlog Dec 29, 2025
@github-actions github-actions bot mentioned this pull request Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Document subtle CORS middleware allowedHeaders behavior

3 participants