responseService = $responseService; } /** * @param RequestInterface $request * @param $next * * @return \Psr\Http\Message\ResponseInterface */ public function handle( RequestInterface $request, $next ) { //return $this->responseService->json( $result )->withHeader('Cache-Control', 'max-age=' . $expiration ); $response = $next( $request ); $response->withHeader('Access-Control-Allow-Origin' , '*'); $response->withHeader('Access-Control-Allow-Methods', 'POST, GET, OPTIONS, PUT, DELETE'); $response->withHeader('Access-Control-Allow-Headers', 'Content-Type, Accept, Authorization, X-Requested-With, Application'); return $response; } }