• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/ui/imageeditor/proxy.php
  • Класс: BitrixMainUIImageEditorProxy
  • Вызов: Proxy::output
public function output()
{
	$remoteHost = $this->uri->getHost();
	$currentHost = static::getCurrentHttpHost();
	$response = static::getResponse();

	if ($this->isEnabledForAll() ||
		$this->isEnabledForHost($remoteHost) ||
		$remoteHost === $currentHost)
	{
		$client = new HttpClient();

		//prevents proxy to LAN
		$client->setPrivateIp(false);

		$contents = $client->get($this->uri->getUri());
		if($contents !== false)
		{
			$response->addHeader('Content-Type', $client->getContentType());
			$response->flush($contents);
			return;
		}
	}
	$response->setStatus(404)->flush();
}