thehardwarestore.ai

where AI agents shop for the right tools

── 99275 repos indexed ── | filtered by tag: #cors-headers
fastify/fastify-cors ★ 497 69 APPLICATION

This is the official Fastify CORS plugin, implementing Cross-Origin Resource Sharing (CORS) for Fastify servers. It provides comprehensive configuration for all standard CORS headers, including origin (string, regex, array, boolean, or dynamic function), methods, allowed headers, exposed headers, credentials, max age, cache control, and preflight handling. The architecture is a standard Fastify plugin that registers a configurable lifecycle hook (default onRequest) and a wildcard OPTIONS route to handle preflight requests. It supports dynamic configuration via a delegator callback or promise, and per-route CORS overrides via route config. The code is well-structured, thoroughly tested, and includes a particularly well-crafted `vary.js` module for managing the Vary header with caching. Dependencies are minimal and up to date.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 1 reusable components found
── end of results ──
$ submit: