You've already forked Php-Template
static test
This commit is contained in:
@@ -34,7 +34,7 @@ class CorsMiddleware implements MiddlewareInterface
|
||||
'trim',
|
||||
explode(
|
||||
',',
|
||||
Config::get('CORS_ALLOWED_ORIGINS', 'https://example.com,https://another.com')
|
||||
Config::get('cors.allowed_origins')
|
||||
)
|
||||
);
|
||||
|
||||
@@ -57,11 +57,11 @@ class CorsMiddleware implements MiddlewareInterface
|
||||
?: 'Content-Type, Authorization'
|
||||
);
|
||||
|
||||
if (Config::get('CORS_ALLOW_CREDENTIALS', 'bool')) {
|
||||
if (Config::get('cors.allow_credentials') === true) {
|
||||
$response = $response->withHeader('Access-Control-Allow-Credentials', 'true');
|
||||
}
|
||||
|
||||
$maxAge = Config::get('CORS_MAX_AGE') ?: '86400';
|
||||
$maxAge = Config::get('CORS_MAX_AGE') !== 3600 ? Config::get('CORS_MAX_AGE') : 3600;
|
||||
|
||||
return $response->withHeader('Access-Control-Max-Age', $maxAge);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user