mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +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\ValidatorServiceProvider;
|
||||
use Silex\Provider\ServiceControllerServiceProvider;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
|
||||
use Unoconv\UnoconvServiceProvider;
|
||||
use XPDF\PdfToText;
|
||||
use XPDF\XPDFServiceProvider;
|
||||
@@ -275,6 +276,9 @@ class Application extends SilexApplication
|
||||
$this->register(new SessionServiceProvider(), array(
|
||||
'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 SwiftmailerServiceProvider());
|
||||
$this->register(new TaskManagerServiceProvider());
|
||||
|
@@ -21,7 +21,7 @@ use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
|
||||
|
||||
class CookiesDisablerSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
private static $NOSESSION_ROUTES = '/^((\/api\/v1)|(\/permalink))/';
|
||||
private static $NOSESSION_ROUTES = '/^((\/api\/v1)|(\/api\/?$)|(\/permalink))/';
|
||||
private $app;
|
||||
private $sessionCookieEnabled = true;
|
||||
|
||||
|
@@ -52,7 +52,8 @@ class CookiesDisablerSubscriberTest extends \PHPUnit_Framework_TestCase
|
||||
return array(
|
||||
array(false, '/prod'),
|
||||
array(false, '/admin'),
|
||||
array(false, '/api'),
|
||||
array(true, '/api'),
|
||||
array(true, '/api/'),
|
||||
array(false, '/api/oauthv2'),
|
||||
array(false, '/'),
|
||||
array(false, '/datafiles/'),
|
||||
|
Reference in New Issue
Block a user