softonic / laravel-request-content-decompress-middleware
Laravel request content decompress middleware
Installs: 25 981
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=7.3
- ext-zlib: *
- illuminate/contracts: ^7.0 || ^8.0
- illuminate/http: ^7.0 || ^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- mockery/mockery: ^1.2
- phpunit/phpunit: ^9.0
README
This middleware adds the ability to automatically decompress the content of a compressed request
Installation
Via composer:
composer require softonic/laravel-request-content-decompress-middleware
Documentation
To use the middleware simply register it in app/Http/Kernel.php
protected $middleware
= [
...
RequestContentDecompress::class,
...
];
From now on all requests having Content-Encoding: gzip
will be automatically decompressed and processed as a uncompressed request.
Testing
softonic/laravel-request-content-decompress-middleware
has a PHPUnit test suite and a coding style compliance test suite using PHP CS Fixer.
To run the tests, run the following command from the project folder.
$ docker-compose run test
License
The Apache 2.0 license. Please see LICENSE for more information.