b13/hydra
Composer 安装命令:
composer require b13/hydra
包简介
Hydra - Allows adding response headers through site config.
README 文档
README
This extension allows to add response headers on a per site base without using TypoScript.
If you have only one set of response headers that you want your TYPO3 websites to send, it might be a good idea to configure the headers directly in your webserver. However, there might be the requirement that different sites inside the same TYPO3 system have to send different headers. In such a case, this extension provides the functionality to configure response headers in the site configuration.
Example
In the site config simply specify the headers:
responseHeaders: Content-Security-Policy: "default-src 'self';" Referrer-Policy: "no-referrer-when-downgrade" X-Content-Type-Options: "nosniff" X-Xss-Protection: "1; mode=block" Feature-Policy: "camera 'none'; geolocation 'none'; microphone 'none'; payment 'none'" Permissions-Policy: "camera=(), geolocation=(), microphone=(), payment=()" X-Frame-Options: "SAMEORIGIN"
To improve maintainability of header configuration with many parts like CSP or Feature-policy each header can be configured as a list. The list items will be concatenated to one string when the header is added. The above example could be rewritten like this:
responseHeaders: Content-Security-Policy: "default-src 'self';" Referrer-Policy: "no-referrer-when-downgrade" X-Content-Type-Options: "nosniff" X-Xss-Protection: "1; mode=block" Feature-Policy: - "camera 'none';" - "geolocation 'none';" - "microphone 'none';" - "payment 'none'" Permissions-Policy: - "camera=()," - "geolocation=()," - "microphone=()," - "payment=()" X-Frame-Options: "SAMEORIGIN"
Those headers will be added via a middleware to responses only for the corresponding site.
Sharing our expertise
Find more TYPO3 extensions we have developed that help us deliver value in client projects. As part of the way we work, we focus on testing and best practices to ensure long-term performance, reliability, and results in all our code.
b13/hydra 适用场景与选型建议
b13/hydra 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13.8k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2021 年 04 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 b13/hydra 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 b13/hydra 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 13.8k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2021-04-27