pionect/laravel-security-headers
Composer 安装命令:
composer require pionect/laravel-security-headers
包简介
Adds security headers to Laravel responses.
README 文档
README
This is a Laravel service provider for adding security header responses to your application.
Installation
The SecurityHeaders Service Provider can be installed via Composer by requiring the
therobfonz/laravel-security-headers package in your project's composer.json.
{
"require": {
"therobfonz/laravel-security-headers": "^3.0"
}
}
Packages are auto-discovered in Laravel 5.6+. Service Providers and Facades are defined in composer.json.
Config File
Publish the confirguration file using Artisan.
php artisan vendor:publish --provider="TheRobFonz\SecurityHeaders\Providers\SecurityHeadersServiceProvider"
Update your settings in the generated config/security.php configuration file.
Configuration
Add the middleware to the 'web' middleware group in App\Http\Kernel.php
protected $middlewareGroups = [ 'web' => [ //... \TheRobFonz\SecurityHeaders\Middleware\RespondWithSecurityHeaders::class,
Nonces
Every inline script tag needs to include the @nonce blade directive in the opening tag.
<script @nonce>
Links
统计信息
- 总下载量: 7.66k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: mit
- 更新时间: 2023-05-23