secureheaders/psradapter

SecureHeaders Psr7 Http Adapter

v0.1-beta1 2017-10-21 19:19 UTC

This package is auto-updated.

Last update: 2024-08-29 04:33:43 UTC


README

SecureHeaders 的 PSR-7 适配器。有关适配器的更多信息,请参阅 SecureHeaders Wiki 中的 框架集成

安装

composer require secureheaders/psradapter

用法

假设您已经有一个 PSR-7 响应对象(例如,从前一个中间件返回)存储在 $response 变量中

// Configure SecureHeaders
$headers = new Aidantwoods\SecureHeaders\SecureHeaders;
$headers->strictMode();

// Instantiate the adapter with your response object
$adapter = new SecureHeaders\PsrHttpAdapter\Psr7Adapter($response);

// Apply your SecureHeaders configuration
$headers->apply($adapter);

// And finally retrieve the updated HTTP response object
$response = $adapter->getSecuredResponse();