mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
PHRAS-1180 Add configuration entry to enable CORS on custom paths
This commit is contained in:
@@ -191,6 +191,7 @@ api_cors:
|
||||
expose_headers: []
|
||||
max_age: 0
|
||||
hosts: []
|
||||
api_cors_paths: []
|
||||
session:
|
||||
idle: 0
|
||||
lifetime: 604800 # 1 week
|
||||
|
@@ -93,6 +93,11 @@ class HttpStackMetaProvider implements ServiceProviderInterface
|
||||
$paths['/api/v\d+/'] = $config;
|
||||
$paths['/download/'] = $config;
|
||||
}
|
||||
if (isset($app['phraseanet.configuration']['api_cors_paths'])) {
|
||||
foreach ($app['phraseanet.configuration']['api_cors_paths'] as $path) {
|
||||
$paths[$path] = $config;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new DefaultProvider($paths, []);
|
||||
|
Reference in New Issue
Block a user