| 1 | <?php |
||
| 10 | class CorsMiddleware implements MiddlewareInterface |
||
| 11 | { |
||
| 12 | protected $headers = [ |
||
| 13 | 'Access-Control-Allow-Origin' => ['*'], |
||
| 14 | 'Access-Control-Request-Method' => ['GET POST'], |
||
| 15 | ]; |
||
| 16 | |||
| 17 | public function addHeader($name, $value): self |
||
| 23 | |||
| 24 | public function __construct(array $headers = []) |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @inheritDoc |
||
| 33 | */ |
||
| 34 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
||
| 40 | |||
| 41 | private function addHeaders(ResponseInterface $response) |
||
| 49 | } |
||
| 50 |