An open API service indexing awesome lists of open source software.

https://github.com/kwhitley/itty-cors

Dead-simple CORS handling for any itty-router API (test with Cloudflare Workers, but works anywhere)!
https://github.com/kwhitley/itty-cors

Last synced: about 2 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# ![itty-cors](https://user-images.githubusercontent.com/865416/193479569-da9e4d63-cd0e-44da-ab00-43322bf4cd51.png)

[![Version](https://img.shields.io/npm/v/itty-cors.svg?style=flat-square)](https://npmjs.com/package/itty-cors)
[![Bundle Size](https://img.shields.io/bundlephobia/minzip/itty-cors?style=flat-square)](https://bundlephobia.com/result?p=itty-cors)
[![Build Status](https://img.shields.io/github/actions/workflow/status/kwhitley/itty-cors/verify.yml?branch=v0.x&style=flat-square)](https://github.com/kwhitley/itty-cors/actions/workflows/verify.yml)
[![Coverage Status](https://img.shields.io/coveralls/github/kwhitley/itty-cors/v0.x?style=flat-square)](https://coveralls.io/github/kwhitley/itty-cors?branch=v0.x)
[![NPM Weekly Downloads](https://img.shields.io/npm/dw/itty-cors?style=flat-square)](https://npmjs.com/package/itty-cors)
[![Open Issues](https://img.shields.io/github/issues/kwhitley/itty-cors?style=flat-square)](https://github.com/kwhitley/itty-cors/issues)

[![Discord](https://img.shields.io/discord/832353585802903572?style=flat-square)](https://discord.com/channels/832353585802903572)
[![GitHub Repo stars](https://img.shields.io/github/stars/kwhitley/itty-cors?style=social)](https://github.com/kwhitley/itty-cors)
[![Twitter](https://img.shields.io/twitter/follow/kevinrwhitley.svg?style=social&label=Follow)](https://www.twitter.com/kevinrwhitley)

# Deprecation Notice
### _`itty-cors` has been fully deprecated in favor of [`itty-router/cors`](https://itty.dev/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