Skip to content

[READ ONLY] Subtree split of the snicco/default-headers-middleware package (see snicco/snicco).

License

Notifications You must be signed in to change notification settings

snicco/default-headers-middleware

Repository files navigation

Middleware for snicco/http-routing that adds default headers to all responses.

codecov Psalm Type-Coverage Psalm level PhpMetrics - Static Analysis PHP-Versions

A middleware for the snicco/http-routing component will add default headers to all outgoing responses.

Installation

composer require snicco/must-match-route-middleware

Usage

This middleware should be added for specific groups or globally in the MiddlewareResolver.

Choose what works best for you.

This middleware must be bound in the PSR-11 container that is used by the snicco/http-routing component.

// In your container definitions
use Snicco\Middleware\DefaultHeaders\DefaultHeaders;

$default_headers = new DefaultHeaders([
    'X-Content-Type-Options' => 'nosniff' // key value pairs or header names and values.
])

Contributing

This repository is a read-only split of the development repo of the Snicco project.

This is how you can contribute.

Reporting issues and sending pull requests

Please report issues in the Snicco monorepo.

Security

If you discover a security vulnerability, please follow our disclosure procedure.

About

[READ ONLY] Subtree split of the snicco/default-headers-middleware package (see snicco/snicco).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages