Expose Middleware
undercloud opened this issue · comments
undercloud commented
Feature
<?php
namespace Psr7Middlewares\Middleware;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
/**
* Middleware to remove php information
*/
class Expose
{
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next)
{
$response = $response->withoutHeader('X-Powered-By');
return $next($request, $response);
}
}
Óscar Otero commented
That's good idea but this header is send automatically by php and the only way to disable it is editing the config variable in php.ini or using:
ini_set('expose_php', 0);