mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-26 08:51:13 -06:00
Reused middleware to check Accept-Language header on any HTTP related middleware
This commit is contained in:
parent
fb9c7f8eec
commit
cd5bbcd60a
14
module/Common/config/middleware-pipeline.config.php
Normal file
14
module/Common/config/middleware-pipeline.config.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
use Shlinkio\Shlink\Common\Middleware;
|
||||
|
||||
return [
|
||||
|
||||
'middleware_pipeline' => [
|
||||
'pre-routing' => [
|
||||
'middleware' => [
|
||||
Middleware\LocaleMiddleware::class,
|
||||
],
|
||||
'priority' => 5,
|
||||
],
|
||||
],
|
||||
];
|
@ -5,6 +5,7 @@ use Doctrine\ORM\EntityManager;
|
||||
use Shlinkio\Shlink\Common\Factory\CacheFactory;
|
||||
use Shlinkio\Shlink\Common\Factory\EntityManagerFactory;
|
||||
use Shlinkio\Shlink\Common\Factory\TranslatorFactory;
|
||||
use Shlinkio\Shlink\Common\Middleware\LocaleMiddleware;
|
||||
use Shlinkio\Shlink\Common\Service\IpLocationResolver;
|
||||
use Shlinkio\Shlink\Common\Twig\Extension\TranslatorExtension;
|
||||
use Zend\I18n\Translator\Translator;
|
||||
@ -20,6 +21,7 @@ return [
|
||||
IpLocationResolver::class => AnnotatedFactory::class,
|
||||
Translator::class => TranslatorFactory::class,
|
||||
TranslatorExtension::class => AnnotatedFactory::class,
|
||||
LocaleMiddleware::class => AnnotatedFactory::class,
|
||||
],
|
||||
'aliases' => [
|
||||
'em' => EntityManager::class,
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Shlinkio\Shlink\Rest\Middleware;
|
||||
namespace Shlinkio\Shlink\Common\Middleware;
|
||||
|
||||
use Acelaya\ZsmAnnotatedServices\Annotation\Inject;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
@ -8,7 +8,6 @@ return [
|
||||
'path' => '/rest',
|
||||
'middleware' => [
|
||||
Middleware\CheckAuthenticationMiddleware::class,
|
||||
Middleware\LocaleMiddleware::class,
|
||||
Middleware\CrossDomainMiddleware::class,
|
||||
],
|
||||
'priority' => 5,
|
||||
|
@ -19,7 +19,6 @@ return [
|
||||
|
||||
Middleware\CrossDomainMiddleware::class => InvokableFactory::class,
|
||||
Middleware\CheckAuthenticationMiddleware::class => AnnotatedFactory::class,
|
||||
Middleware\LocaleMiddleware::class => AnnotatedFactory::class,
|
||||
],
|
||||
],
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user