You've already forked Php-Template
tests
This commit is contained in:
@@ -13,7 +13,6 @@ use Nyholm\Psr7\Response;
|
||||
*/
|
||||
class JsonResponseFactory
|
||||
{
|
||||
|
||||
/**
|
||||
* Create a JSON response with the given data and status code.
|
||||
*
|
||||
@@ -32,4 +31,4 @@ class JsonResponseFactory
|
||||
body: json_encode($data, JSON_THROW_ON_ERROR)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,10 +31,12 @@ class CorsMiddleware implements MiddlewareInterface
|
||||
{
|
||||
$origin = $request->getHeaderLine('Origin');
|
||||
$allowedOrigins = array_map(
|
||||
'trim', explode(
|
||||
',',
|
||||
Config::get('CORS_ALLOWED_ORIGINS', 'https://example.com,https://another.com')
|
||||
));
|
||||
'trim',
|
||||
explode(
|
||||
',',
|
||||
Config::get('CORS_ALLOWED_ORIGINS', 'https://example.com,https://another.com')
|
||||
)
|
||||
);
|
||||
|
||||
$allowOrigin = in_array($origin, $allowedOrigins, true)
|
||||
? $origin
|
||||
@@ -63,4 +65,4 @@ class CorsMiddleware implements MiddlewareInterface
|
||||
|
||||
return $response->withHeader('Access-Control-Max-Age', $maxAge);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user