mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
Fix api cookies remover
Conflicts: lib/Alchemy/Phrasea/Application.php
This commit is contained in:
@@ -124,6 +124,7 @@ use Silex\Provider\SwiftmailerServiceProvider;
|
|||||||
use Silex\Provider\UrlGeneratorServiceProvider;
|
use Silex\Provider\UrlGeneratorServiceProvider;
|
||||||
use Silex\Provider\ValidatorServiceProvider;
|
use Silex\Provider\ValidatorServiceProvider;
|
||||||
use Silex\Provider\ServiceControllerServiceProvider;
|
use Silex\Provider\ServiceControllerServiceProvider;
|
||||||
|
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
|
||||||
use Unoconv\UnoconvServiceProvider;
|
use Unoconv\UnoconvServiceProvider;
|
||||||
use XPDF\PdfToText;
|
use XPDF\PdfToText;
|
||||||
use XPDF\XPDFServiceProvider;
|
use XPDF\XPDFServiceProvider;
|
||||||
@@ -275,6 +276,9 @@ class Application extends SilexApplication
|
|||||||
$this->register(new SessionServiceProvider(), array(
|
$this->register(new SessionServiceProvider(), array(
|
||||||
'session.test' => $this->getEnvironment() === static::ENV_TEST
|
'session.test' => $this->getEnvironment() === static::ENV_TEST
|
||||||
));
|
));
|
||||||
|
$this['session.storage.test'] = $this->share(function($app) {
|
||||||
|
return new MockArraySessionStorage();
|
||||||
|
});
|
||||||
$this->register(new ServiceControllerServiceProvider());
|
$this->register(new ServiceControllerServiceProvider());
|
||||||
$this->register(new SwiftmailerServiceProvider());
|
$this->register(new SwiftmailerServiceProvider());
|
||||||
$this->register(new TaskManagerServiceProvider());
|
$this->register(new TaskManagerServiceProvider());
|
||||||
|
@@ -21,7 +21,7 @@ use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
|
|||||||
|
|
||||||
class CookiesDisablerSubscriber implements EventSubscriberInterface
|
class CookiesDisablerSubscriber implements EventSubscriberInterface
|
||||||
{
|
{
|
||||||
private static $NOSESSION_ROUTES = '/^((\/api\/v1)|(\/permalink))/';
|
private static $NOSESSION_ROUTES = '/^((\/api\/v1)|(\/api\/?$)|(\/permalink))/';
|
||||||
private $app;
|
private $app;
|
||||||
private $sessionCookieEnabled = true;
|
private $sessionCookieEnabled = true;
|
||||||
|
|
||||||
|
@@ -52,7 +52,8 @@ class CookiesDisablerSubscriberTest extends \PHPUnit_Framework_TestCase
|
|||||||
return array(
|
return array(
|
||||||
array(false, '/prod'),
|
array(false, '/prod'),
|
||||||
array(false, '/admin'),
|
array(false, '/admin'),
|
||||||
array(false, '/api'),
|
array(true, '/api'),
|
||||||
|
array(true, '/api/'),
|
||||||
array(false, '/api/oauthv2'),
|
array(false, '/api/oauthv2'),
|
||||||
array(false, '/'),
|
array(false, '/'),
|
||||||
array(false, '/datafiles/'),
|
array(false, '/datafiles/'),
|
||||||
|
Reference in New Issue
Block a user