Skip to content

fix(api-server): improve CORS headers#3384

Closed
aydnOktay wants to merge 2 commits into
NousResearch:mainfrom
aydnOktay:fix/api-server-cors-idempotency-vary
Closed

fix(api-server): improve CORS headers#3384
aydnOktay wants to merge 2 commits into
NousResearch:mainfrom
aydnOktay:fix/api-server-cors-idempotency-vary

Conversation

@aydnOktay

Copy link
Copy Markdown
Contributor

This PR makes two small, high-impact CORS improvements for the API server:

  • Allow Idempotency-Key in Access-Control-Allow-Headers so browser clients can use idempotency safely.
  • Ensure Vary: Origin is set for CORS responses to prevent cache/proxy mix-ups between different origins.

Tests:

  • Add unit tests that assert Idempotency-Key is allowed on preflight and Vary: Origin is returned for allowed origins.

@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #3530. Your Idempotency-Key CORS fix was cherry-picked onto current main with authorship preserved. The Vary: Origin middleware changes were dropped since that behavior already exists in _cors_headers_for_origin() on current main. Thanks for the contribution @aydnOktay!

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