Added HEAD request implicit handling

This commit is contained in:
Alejandro Celaya 2020-04-08 17:27:26 +02:00
parent 2b1011de52
commit ec8cbf82e5

View file

@ -5,8 +5,9 @@ declare(strict_types=1);
namespace Shlinkio\Shlink; namespace Shlinkio\Shlink;
use Laminas\Stratigility\Middleware\ErrorHandler; use Laminas\Stratigility\Middleware\ErrorHandler;
use Mezzio; use Mezzio\Helper;
use Mezzio\ProblemDetails; use Mezzio\ProblemDetails;
use Mezzio\Router;
use PhpMiddleware\RequestId\RequestIdMiddleware; use PhpMiddleware\RequestId\RequestIdMiddleware;
return [ return [
@ -14,7 +15,7 @@ return [
'middleware_pipeline' => [ 'middleware_pipeline' => [
'error-handler' => [ 'error-handler' => [
'middleware' => [ 'middleware' => [
Mezzio\Helper\ContentLengthMiddleware::class, Helper\ContentLengthMiddleware::class,
ErrorHandler::class, ErrorHandler::class,
], ],
], ],
@ -35,14 +36,15 @@ return [
'routing' => [ 'routing' => [
'middleware' => [ 'middleware' => [
Mezzio\Router\Middleware\RouteMiddleware::class, Router\Middleware\RouteMiddleware::class,
Router\Middleware\ImplicitHeadMiddleware::class,
], ],
], ],
'rest' => [ 'rest' => [
'path' => '/rest', 'path' => '/rest',
'middleware' => [ 'middleware' => [
Mezzio\Router\Middleware\ImplicitOptionsMiddleware::class, Router\Middleware\ImplicitOptionsMiddleware::class,
Rest\Middleware\BodyParserMiddleware::class, Rest\Middleware\BodyParserMiddleware::class,
Rest\Middleware\AuthenticationMiddleware::class, Rest\Middleware\AuthenticationMiddleware::class,
], ],
@ -50,7 +52,7 @@ return [
'dispatch' => [ 'dispatch' => [
'middleware' => [ 'middleware' => [
Mezzio\Router\Middleware\DispatchMiddleware::class, Router\Middleware\DispatchMiddleware::class,
], ],
], ],
@ -67,4 +69,11 @@ return [
], ],
], ],
], ],
'dependencies' => [
'factories' => [
Router\Middleware\ImplicitHeadMiddleware::class => Router\Middleware\ImplicitHeadMiddlewareFactory::class,
],
],
]; ];