You've already forked Php-Template
static test
This commit is contained in:
@@ -16,7 +16,7 @@ class JsonResponseFactory
|
||||
/**
|
||||
* Create a JSON response with the given data and status code.
|
||||
*
|
||||
* @param mixed $data The data to include in the response.
|
||||
* @param array $data The data to include in the response.
|
||||
* @param int $statusCode The HTTP status code for the response.
|
||||
* @return Response The JSON response.
|
||||
* @throws \JsonException
|
||||
|
||||
@@ -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