• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/httpapplication.php
  • Класс: BitrixMainHttpApplication
  • Вызов: HttpApplication::finalizeControllerResult
private function finalizeControllerResult($controller, $result, ErrorCollection $errorCollection): void
{
	$response = $this->buildResponse($result, $errorCollection);
	$response = $this->context->getResponse()->copyHeadersTo($response);

	if ($controller)
	{
		$controller->finalizeResponse($response);
	}

	$this->context->setResponse($response);

	//todo exit code in Response?
	$this->end(0, $response);
}