https://github.com/softonic/laravel-request-content-decompress-middleware
Laravel request content decompress middleware
https://github.com/softonic/laravel-request-content-decompress-middleware
content-encoding gzip laravel middleware php requests unzip
Last synced: 12 months ago
JSON representation
Laravel request content decompress middleware
- Host: GitHub
- URL: https://github.com/softonic/laravel-request-content-decompress-middleware
- Owner: softonic
- License: other
- Created: 2019-07-04T13:26:54.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-11-05T15:27:17.000Z (over 5 years ago)
- Last Synced: 2025-05-12T09:27:50.818Z (about 1 year ago)
- Topics: content-encoding, gzip, laravel, middleware, php, requests, unzip
- Language: PHP
- Size: 9.77 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
Laravel request content decompress middleware
=====
[](https://github.com/softonic/laravel-request-content-decompress-middleware/releases)
[](LICENSE.md)
[](https://travis-ci.org/softonic/laravel-request-content-decompress-middleware)
[](https://scrutinizer-ci.com/g/softonic/laravel-request-content-decompress-middleware/code-structure)
[](https://scrutinizer-ci.com/g/softonic/laravel-request-content-decompress-middleware)
[](https://packagist.org/packages/softonic/laravel-request-content-decompress-middleware)
[](http://isitmaintained.com/project/softonic/laravel-request-content-decompress-middleware "Average time to resolve an issue")
[](http://isitmaintained.com/project/softonic/laravel-request-content-decompress-middleware "Percentage of issues still open")
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](https://phpunit.de) test suite and a coding style compliance test suite using [PHP CS Fixer](http://cs.sensiolabs.org/).
To run the tests, run the following command from the project folder.
``` bash
$ docker-compose run test
```
License
-------
The Apache 2.0 license. Please see [LICENSE](LICENSE) for more information.
[PSR-2]: http://www.php-fig.org/psr/psr-2/
[PSR-4]: http://www.php-fig.org/psr/psr-4/