# asm89/stack-cors

Cross-origin resource sharing library and stack middleware.

Repository: https://github.com/asm89/stack-cors
Canonical: https://ross.abutalabs.com/products/stack-cors
Language: PHP
License: MIT
License Family: permissive
Last push: 2026-01-28T13:08:35+00:00

## Health v2 (maintenance only)
Score: 61/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 64, release rhythm 36, longevity 100
- inputs: {"age_days": 4768, "days_push": 217, "days_rel": 217, "gap_med": 320, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1276, forks 61 (observed 2026-08-28T04:04:13.087547+00:00)

## What it is
A PHP library and Stack middleware that implements the W3C CORS recommendation for http-foundation/http-kernel based applications. It can be used standalone as a CorsService or wrapped around an application as Stack middleware to handle preflight and actual CORS requests.

## Use cases
- add CORS headers to a PHP HTTP application
- handle preflight OPTIONS requests
- allow cross-origin API access from browsers
- configure allowed origins, methods, and headers for CORS
- enable credentialed cross-origin requests

## When to choose
- you run a Symfony, Laravel, or StackPHP-style PHP app needing CORS support
- you want a small, standards-compliant CORS implementation usable as library or middleware

## When to avoid
- your framework already ships a maintained CORS package you prefer
- you are not using http-foundation/http-kernel based request/response objects

## Facets
- artifact type: library
- maturity: stable
- function: middleware, http-server, security
- domain: web-development, backend, apis, security
- platform: php
- tags: cors, stackphp, http-foundation, http-kernel, cross-origin

## Member repositories
- asm89/stack-cors (main) score 61

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:13.087547+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T05:02:55.637489+00:00, confidence not recorded.
  - readme: https://github.com/asm89/stack-cors (fetched 2026-08-28T04:04:13.087547+00:00, sha 4c7718fd7c19)
- Data as of 2026-08-30T08:39:29.467469+00:00.
