Search code examples
mezzio

Remove header when return response


I am using expressive 2 for a webservice, but when I return a JsonResponse it return the X-Powered-By →PHP/7.1.1 header, how to remove it from response?

class ProfileAction
{

/** @var UsersTable */
private $usersTable;

public function __construct( UsersTable $usersTable )
{
    $this->usersTable = $usersTable;
}

public function __invoke( ServerRequestInterface $request, ResponseInterface $response, callable $next = null)
{

    // TODO: Implement __invoke() method.
    return new JsonResponse(['profile'=>true]);

}

}


Solution

  • I just found the answer on Google just disable on php.ini expose_php=Off.