first commit

This commit is contained in:
Sampanna Rimal
2024-08-27 17:48:06 +05:45
commit 53c0140f58
10839 changed files with 1125847 additions and 0 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);
}
}