| 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 | /** |
||
| 25 | * @inheritDoc |
||
| 26 | */ |
||
| 27 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
||
| 33 | |||
| 34 | private function addHeaders(ResponseInterface $response) |
||
| 42 | } |
||
| 43 |