PHPackages                             middlewares/csp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. middlewares/csp

ActiveLibrary[HTTP &amp; Networking](/categories/http)

middlewares/csp
===============

Middleware to add the Content-Security-Policy header to the response

v3.2.0(1y ago)1720.6k↓42.2%MITPHP ^7.2 || ^8.0

Since Oct 9Compare

[ Source](https://github.com/middlewares/csp)[ Packagist](https://packagist.org/packages/middlewares/csp)[ Docs](https://github.com/middlewares/csp)[ RSS](/packages/middlewares-csp/feed)WikiDiscussions Synced 1mo ago

READMEChangelogDependencies (9)Versions (16)Used By (0)

### README not available

The README for this package hasn't been synced yet. View it on [GitHub](https://github.com/middlewares/csp).

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance46

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 96.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~220 days

Recently: every ~605 days

Total

15

Last Release

421d ago

Major Versions

v0.6.0 → v1.0.02018-01-26

v1.0.1 → v2.0.02018-08-04

v2.0.0 → v3.0.02019-12-01

PHP version history (4 changes)v0.1.0PHP ^5.6 || ^7.0

v0.6.0PHP ^7.0

v3.0.0PHP ^7.2

v3.1.1PHP ^7.2 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/e99df56b617f4af8cf0556a51a0ca20c7420104920c57d7e9eab093f92bb744f?d=identicon)[oscarotero](/maintainers/oscarotero)

![](https://www.gravatar.com/avatar/42e0d72f42eb7d84f67e20d28606da42e5a3248ca908b1eadb4366aafeae2561?d=identicon)[filisko](/maintainers/filisko)

---

Top Contributors

[![oscarotero](https://avatars.githubusercontent.com/u/377873?v=4)](https://github.com/oscarotero "oscarotero (54 commits)")[![filisko](https://avatars.githubusercontent.com/u/8798694?v=4)](https://github.com/filisko "filisko (2 commits)")

---

Tags

httppsr-7middlewaresecuritypsr-15cspcontent-security-policy

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/middlewares-csp/health.svg)

```
[![Health](https://phpackages.com/badges/middlewares-csp/health.svg)](https://phpackages.com/packages/middlewares-csp)
```

###  Alternatives

[mezzio/mezzio

PSR-15 Middleware Microframework

3883.6M97](/packages/mezzio-mezzio)[middlewares/utils

Common utils for PSR-15 middleware packages

503.4M92](/packages/middlewares-utils)[middlewares/firewall

Middleware to provide IP filtering

12318.3k2](/packages/middlewares-firewall)[mezzio/mezzio-authentication

Authentication middleware for Mezzio and PSR-7 applications

121.6M26](/packages/mezzio-mezzio-authentication)[middlewares/cors

Middleware to implement Cross-Origin Resource Sharing (CORS)

1372.2k3](/packages/middlewares-cors)[middlewares/referrer-spam

Middleware to block referrer spammers

1159.4k1](/packages/middlewares-referrer-spam)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
