* php cs fixes, testing ci build

This commit is contained in:
Dávid Danyi
2017-03-22 16:01:34 +01:00
parent 8d7f1b68c6
commit 951ca64943
7 changed files with 135 additions and 79 deletions

View File

@@ -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);
}