package and depencies

This commit is contained in:
RafficMohammed
2023-01-08 02:57:24 +05:30
parent d5332eb421
commit 1d54b8bc7f
4309 changed files with 193331 additions and 172289 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace Spatie\FlareClient\FlareMiddleware;
use Spatie\FlareClient\Report;
class CensorRequestHeaders implements FlareMiddleware
{
protected array $headers = [];
public function __construct(array $headers)
{
$this->headers = $headers;
}
public function handle(Report $report, $next)
{
$context = $report->allContext();
foreach ($this->headers as $header) {
$header = strtolower($header);
if (isset($context['headers'][$header])) {
$context['headers'][$header] = '<CENSORED>';
}
}
$report->userProvidedContext($context);
return $next($report);
}
}