Skip to content

Commit

Permalink
Added X-Powered-By header
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed Dec 20, 2016
1 parent db4d5a7 commit 38a3459
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 16 deletions.
27 changes: 11 additions & 16 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions config/autoload/middleware-pipeline.global.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Redirects::class => InvokableFactory::class,
NotFound::class => Factory\NotFoundFactory::class,
XClacksOverhead::class => InvokableFactory::class,
XPoweredBy::class => InvokableFactory::class,
],
],
];
1 change: 1 addition & 0 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
$app->pipe(ErrorHandler::class);
$app->pipe(ContentSecurityPolicy::class);
$app->pipe(XClacksOverhead::class);
$app->pipe(XPoweredBy::class);
$app->pipe(Redirects::class);
$app->pipe('/auth', Auth\Middleware::class);
$app->pipeRoutingMiddleware();
Expand Down
19 changes: 19 additions & 0 deletions src/XPoweredBy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
* @license http://opensource.org/licenses/BSD-2-Clause BSD-2-Clause
* @copyright Copyright (c) Matthew Weier O'Phinney
*/

namespace Mwop;

use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;

class XPoweredBy
{
public function __invoke(Request $req, Response $res, callable $next) : Response
{
$res = $next($req, $res);
return $res->withHeader('X-Powered-By', 'Coffee, Beer, and Whiskey, in no particular order');
}
}

0 comments on commit 38a3459

Please sign in to comment.