Move Powered By Header to headers config (#2777)

* Move Powered By Header to headers config
* Use Arr::get()
This commit is contained in:
Matt Kilgore 2021-04-29 18:30:01 -04:00 committed by GitHub
parent 56a02944f1
commit 9aa50ca6e3

View File

@ -10,6 +10,7 @@
namespace Flarum\Http\Middleware;
use Flarum\Foundation\Config;
use Illuminate\Support\Arr;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface as Middleware;
@ -21,7 +22,7 @@ class FlarumPromotionHeader implements Middleware
public function __construct(Config $config)
{
$this->enabled = $config['poweredByHeader'] ?? true;
$this->enabled = Arr::get($config, 'headers.poweredByHeader') ?? true;
}
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface