/** * @param \Concrete\Core\Http\Middleware\DelegateInterface $frame * @return Response */ public function process(Request $request, DelegateInterface $frame) { $response = $frame->next($request); if ($response->headers->has('X-Frame-Options') === false) { $x_frame_options = $this->config->get('concrete.security.misc.x_frame_options'); if ($this->stringValidator->notempty($x_frame_options)) { $response->headers->set('X-Frame-Options', $x_frame_options); } } return $response; }
/** * Add or remove cookies from the * @param Request $request * @param \Concrete\Core\Http\Middleware\DelegateInterface $frame * @return Response */ public function process(Request $request, DelegateInterface $frame) { $this->cookies->setRequest($request); /** @var Response $response */ $response = $frame->next($request); $cleared = $this->cookies->getClearedCookies(); foreach ($cleared as $cookie) { $response->headers->clearCookie($cookie); } $cookies = $this->cookies->getCookies(); foreach ($cookies as $cookie) { $response->headers->setCookie($cookie); } return $response; }
/** * Apply the request instance to the request singleton * @param \Symfony\Component\HttpFoundation\Request $request * @param \Concrete\Core\Http\Middleware\DelegateInterface $frame * @return \Symfony\Component\HttpFoundation\Response */ public function process(Request $request, DelegateInterface $frame) { \Concrete\Core\Http\Request::setInstance($request); $this->app->instance('Concrete\\Core\\Http\\Request', $request); return $frame->next($request); }