* php cs fixes, testing ci build
This commit is contained in:
@@ -7,6 +7,18 @@ use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
class PreFlightMiddleware
|
||||
{
|
||||
const ALLOW_HEADERS = [
|
||||
'DNT',
|
||||
'X-CustomHeader',
|
||||
'Keep-Alive',
|
||||
'User-Agent',
|
||||
'X-Requested-With',
|
||||
'If-Modified-Since',
|
||||
'Cache-Control',
|
||||
'Content-Type',
|
||||
'Authorization',
|
||||
];
|
||||
|
||||
public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next)
|
||||
{
|
||||
$requestMethod = strtoupper($request->getMethod());
|
||||
@@ -15,7 +27,7 @@ class PreFlightMiddleware
|
||||
->withHeader('Accept', 'OPTIONS,GET,POST,PUT,PATCH,DELETE')
|
||||
->withHeader('Access-Control-Allow-Origin', '*')
|
||||
->withHeader('Access-Control-Allow-Methods', 'OPTIONS,GET,POST,PUT,PATCH,DELETE')
|
||||
->withHeader('Access-Control-Allow-Headers', 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization');
|
||||
->withHeader('Access-Control-Allow-Headers', implode(",", self::ALLOW_HEADERS));
|
||||
}
|
||||
return $next($request, $response);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user