Example #1
0
 /**
  * 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());
 }
Example #2
0
 /**
  * {@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;
 }
Example #3
0
 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());
 }