Skip to content

refactor: optimize handler flow and unify CORS origin check#7

Merged
masonlet merged 2 commits into
mainfrom
refactor/optimize-handler
Mar 23, 2026
Merged

refactor: optimize handler flow and unify CORS origin check#7
masonlet merged 2 commits into
mainfrom
refactor/optimize-handler

Conversation

@masonlet

Copy link
Copy Markdown
Owner

Changes

  • Moves checkRateLimit after method, content-type, honeypot, and body validation - avoid vercel WAF call for all invalid requests
  • Removes isOriginAllowed; folds origin check into setCorsHeaders which now returns "preflight" | "forbidden" | "ok" instead of a Boolean
  • Fixes disallowed OPTIONS preflight showing success instead of error

@vercel

vercel Bot commented Mar 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
contact-api Ready Ready Preview, Comment Mar 23, 2026 6:28pm

@masonlet masonlet merged commit 4af840d into main Mar 23, 2026
3 checks passed
@masonlet masonlet deleted the refactor/optimize-handler branch March 23, 2026 18:29
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.

1 participant