mirror of
https://github.com/flarum/framework.git
synced 2025-02-24 05:33:42 +08:00
Revert "Add a middleware for authentication with CGI wrap"
This reverts commit 63cf4a3d34846167a80166f28ef91a18a8f75ca0. This will now be dealt with at the Stratigility level.
This commit is contained in:
parent
63cf4a3d34
commit
537725e89d
@ -33,7 +33,6 @@ class Server extends AbstractServer
|
|||||||
$pipe->pipe($path, $app->make('Flarum\Api\Middleware\FakeHttpMethods'));
|
$pipe->pipe($path, $app->make('Flarum\Api\Middleware\FakeHttpMethods'));
|
||||||
$pipe->pipe($path, $app->make('Flarum\Http\Middleware\StartSession'));
|
$pipe->pipe($path, $app->make('Flarum\Http\Middleware\StartSession'));
|
||||||
$pipe->pipe($path, $app->make('Flarum\Http\Middleware\RememberFromCookie'));
|
$pipe->pipe($path, $app->make('Flarum\Http\Middleware\RememberFromCookie'));
|
||||||
$pipe->pipe($path, $app->make('Flarum\Http\Middleware\SharedHosts'));
|
|
||||||
$pipe->pipe($path, $app->make('Flarum\Http\Middleware\AuthenticateWithSession'));
|
$pipe->pipe($path, $app->make('Flarum\Http\Middleware\AuthenticateWithSession'));
|
||||||
$pipe->pipe($path, $app->make('Flarum\Http\Middleware\AuthenticateWithHeader'));
|
$pipe->pipe($path, $app->make('Flarum\Http\Middleware\AuthenticateWithHeader'));
|
||||||
$pipe->pipe($path, $app->make('Flarum\Http\Middleware\SetLocale'));
|
$pipe->pipe($path, $app->make('Flarum\Http\Middleware\SetLocale'));
|
||||||
|
@ -1,35 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
* This file is part of Flarum.
|
|
||||||
*
|
|
||||||
* (c) Toby Zerner <toby.zerner@gmail.com>
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Flarum\Http\Middleware;
|
|
||||||
|
|
||||||
use Psr\Http\Message\ResponseInterface as Response;
|
|
||||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
|
||||||
use Zend\Stratigility\MiddlewareInterface;
|
|
||||||
|
|
||||||
class SharedHosts implements MiddlewareInterface
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function __invoke(Request $request, Response $response, callable $out = null)
|
|
||||||
{
|
|
||||||
$SERVER = $request->getServerParams();
|
|
||||||
|
|
||||||
// CGI wrap may not pass on the Authorization header.
|
|
||||||
// In that case, the web server can be configured
|
|
||||||
// to pass its value in an env variable instead.
|
|
||||||
if (isset($SERVER['REDIRECT_HTTP_AUTHORIZATION'])) {
|
|
||||||
$request = $request->withHeader('authorization', $SERVER['REDIRECT_HTTP_AUTHORIZATION']);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $out ? $out($request, $response) : $response;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user