项目作者: m1guelpf

项目描述 :
A Laravel ratelimiter that supports ETag headers
高级语言: PHP
项目地址: git://github.com/m1guelpf/laravel-etag.git
创建时间: 2018-04-11T14:23:42Z
项目社区:https://github.com/m1guelpf/laravel-etag

开源协议:MIT License

下载


A Laravel ratelimiter that supports ETag

Latest Version on Packagist
Total Downloads

Installation

You can install the package via composer:

  1. composer require m1guelpf/laravel-etag

To use it, you must replace the throttle middleware in your Http Kernel file with \M1guelpf\Etag\EtagMiddleware::class:

  1. // app/Http/Kernel.php
  2. ...
  3. protected $routeMiddleware = [
  4. ...
  5. 'throttle' => \M1guelpf\Etag\EtagMiddleware::class,
  6. ];

Usage

To throttle a route while respecting ETag headers, just add the throttle middleware like you’d do without the package:

  1. // in a routes file
  2. Route::get('my-page', 'MyController')->middleware('throttle');

All the options available for the stock Laravel throttle are also applicable with this package.

Security

If you discover any security related issues, please email soy@miguelpiedrafita.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.