kwhitley / itty-cors

Dead-simple CORS handling for any itty-router API (test with Cloudflare Workers, but works anywhere)!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

itty-cors

Version Bundle Size Build Status Coverage Status NPM Weekly Downloads Open Issues

Discord GitHub Repo stars Twitter

Deprecation Notice

itty-cors has been fully deprecated in favor of itty-router/cors.

This complete rewrite brings the following:

  1. full support for industry-standard options (matches express.js)
  2. far more control of matching/reflecting origins
  3. true wildcard support
  4. fixes a nasty race condition that could appear under heavy multi-user load
  5. 20% smaller (we somehow shed over 100 bytes)
  6. 100% test coverage, like anything in itty-router core

itty-router v5.x CORS Guide

https://itty.dev/itty-router/cors

v5.x Migration Guide

https://itty.dev/itty-router/migrations/v4-v5

About

Dead-simple CORS handling for any itty-router API (test with Cloudflare Workers, but works anywhere)!

License:MIT License


Languages

Language:TypeScript 100.0%