/** * Filters the Response. * * @param FilterResponseEvent $event */ public function onKernelResponse(FilterResponseEvent $event) { if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { return; } $this->turbolinks->decorateResponse($event->getRequest(), $event->getResponse()); }
/** * {@inheritdoc} */ public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true) { $response = $this->app->handle($request, $type, $catch); if (self::MASTER_REQUEST === $type) { $this->turbolinks->decorateResponse($request, $response); } return $response; }
public function testDeletesRequestMethodCookie() { $request = Request::create('/', 'GET', array(), array('request_method' => 'POST')); $response = new Response('foo'); $this->turbolinks->decorateResponse($request, $response); $this->assertRegExp('/Set-Cookie: request_method=deleted;/m', $response->headers->__toString()); }