public function __invoke($application, $response)
{
if ($response instanceof JsonResponse && ($payload = $response->getPayload()) instanceof \stdClass) {
if ($this->forwardHasHappened && !isset($payload->redirect)) {
$payload->url = $application->getPresenter()->link('this');
}
$this->httpResponse->addHeader('Vary', 'X-Requested-With');
}
}