asgrim / random-status-code-middleware
Middleware to set a random status code
0.0.1
2019-06-26 14:32 UTC
Requires
- php: >=7.3.0,<7.4.0
- psr/http-message: ^1.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- doctrine/coding-standard: ^6.0
- phpunit/phpunit: ^8.2
- vimeo/psalm: ^3.4
- zendframework/zend-diactoros: ^2.1
This package is auto-updated.
Last update: 2024-10-27 03:57:39 UTC
README
Randomise the status code returned from a middleware pipeline.
Given a middleware pipeline, change the HTTP status code to a new random status code.
Inspired by my own tweet: https://twitter.com/asgrim/status/1143523405335019520
Installation
composer require asgrim/random-status-middleware
Usage
Add \Asgrim\RandomStatusMiddleware\RandomStatusMiddleware
into your middleware pipeline. Probably works best towards
the outermost layer to ensure the status code is not overwritten unintentionally by another middleware.