m1guelpf / laravel-etag
A Laravel 速率限制器,支持 ETag 头。
v1.1.1
2018-09-04 15:36 UTC
Requires
- php: ^7.0
- illuminate/http: ~5.5|~5.6|~5.7
- illuminate/support: ~5.5|~5.6|~5.7
This package is auto-updated.
Last update: 2024-09-17 04:59:04 UTC
README
安装
您可以通过 composer 安装此包
composer require m1guelpf/laravel-etag
要使用它,您必须将您的 Http Kernel 文件中的 throttle 中间件替换为 \M1guelpf\Etag\EtagMiddleware::class
// app/Http/Kernel.php ... protected $routeMiddleware = [ ... 'throttle' => \M1guelpf\Etag\EtagMiddleware::class, ];
用法
要限制路由的速率同时尊重 ETag 头,只需添加 throttle 中间件,就像不使用包一样
// in a routes file Route::get('my-page', 'MyController')->middleware('throttle');
Laravel throttle 提供的所有选项也适用于此包。
安全性
如果您发现任何与安全性相关的问题,请通过电子邮件 soy@miguelpiedrafita.com 联系,而不是使用问题跟踪器。
致谢
许可证
MIT 许可证 (MIT)。有关更多信息,请参阅 许可证文件。