Skip to content

perf(api): only send Content-Type: application/json when there's a body - #765

Closed
yggdrasilworld wants to merge 1 commit into
MergeFi:mainfrom
yggdrasilworld:fix/get-content-type-cors-686
Closed

yggdrasilworld wants to merge 1 commit into
MergeFi:mainfrom
yggdrasilworld:fix/get-content-type-cors-686

Conversation

@yggdrasilworld

@yggdrasilworld yggdrasilworld commented Oct 14, 2026 •

Copy link
Copy Markdown

What

A GET carrying Content-Type: application/json isn't a CORS 'simple request' — it triggered a preflight on every read, doubling fetch latency.

Fix

Only declare it when a body is actually sent.

Resolves #686

Payment: Base USDC 0xD40Df5c27cEa7dd78A3c345401995c319589334e

@vercel

vercel Bot commented Oct 14, 2026

Copy link
Copy Markdown

@yggdrasilworld is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

@yggdrasilworld
yggdrasilworld force-pushed the fix/get-content-type-cors-686 branch from e93ee40 to 38156be Compare October 16, 2026 12:34
A GET carrying Content-Type: application/json isn't a CORS 'simple request'
— it triggers a preflight on every read, doubling fetch latency. Declare it
only when a body is actually sent.

Resolves MergeFi#686
@yggdrasilworld

Copy link
Copy Markdown
Author

Rebased onto current main — the equivalent change has already landed upstream (post-rebase diff vs main is empty), so this PR is superseded. Closing.

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.

Browser-side GETs send Content-Type: application/json, triggering a CORS preflight on every request and poll

1 participant