firesphere/permissionheaders

为网站设置权限头

安装: 28

依赖项: 0

建议者: 0

安全: 0

类型:silverstripe-vendormodule

0.3.0 2024-07-11 04:56 UTC

This package is auto-updated.

Last update: 2024-09-11 07:39:51 UTC


README

许可证

LGPL v3 或更新版本

首先

在使用此模块将所有权限添加到您的应用程序之前,请确保您至少在基本水平上,了解权限头是什么。

https://mdn.org.cn/en-US/docs/Web/HTTP/Headers/Permissions-Policy

以及 CORS

https://mdn.org.cn/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers

代码状态

根据配置的 yml 文件添加权限头到您的请求。

要求

SilverStripe 框架 4.x+ PHP 8.0+

安装

composer require firesphere/permissionheaders

配置和使用

启用您想要的选项

Firesphere\PermissionHeaders\Config\PermissionConfig:
  permissions:
    enabled: false
  referrer: same-origin
  frame-options: SAMEORIGIN
  content-type-options: nosniff
  CORS:
      enabled: false
  HSTS:
      enabled: false

查看包含的 config.yml,了解如何使用策略的示例。

默认情况下是关闭的!

警告

.htaccess、Apache site.confnginx.conf 文件中设置的任何头都将覆盖此模块设置的头。

您是否阅读了整个 README?太棒了!

下面有一头牛,专门为您。


               /( ,,,,, )\
              _\,;;;;;;;,/_
           .-"; ;;;;;;;;; ;"-.
           '.__/`_ / \ _`\__.'
              | (')| |(') |
              | .--' '--. |
              |/ o     o \|
              |           |
             / \ _..=.._ / \
            /:. '._____.'   \
           ;::'    / \      .;
           |     _|_ _|_   ::|
         .-|     '==o=='    '|-.
        /  |  . /       \    |  \
        |  | ::|         |   | .|
        |  (  ')         (.  )::|
        |: |   |;  U U  ;|:: | `|
        |' |   | \ U U / |'  |  |
        ##V|   |_/`"""`\_|   |V##
           ##V##         ##V##