Skip to content

Commit

Permalink
Move Powered By Header to headers config (#2777)
Browse files Browse the repository at this point in the history
* Move Powered By Header to headers config
* Use Arr::get()
  • Loading branch information
tankerkiller125 authored Apr 29, 2021
1 parent 8a431dc commit 6b9e991
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Http/Middleware/FlarumPromotionHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down

0 comments on commit 6b9e991

Please sign in to comment.