• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/web/http/response.php
  • Класс: BitrixMainWebHttpResponse
  • Вызов: Response::adjustHeaders
public function adjustHeaders(): void
{
	// If a Client chooses to decompress the message body then it MUST also remove the Content-Encoding header and adjust the Content-Length header
	if (strtolower($this->headers->get('Content-Encoding') ?? '') == 'gzip')
	{
		$this->headers->delete('Content-Encoding');

		if ($this->headers->has('Content-Length'))
		{
			$size = $this->body->getSize();
			if ($size !== null)
			{
				$this->headers->set('Content-Length', $size);
			}
			else
			{
				$this->headers->delete('Content-Length');
			}
		}
	}

	// Already dechunked
	if (strtolower($this->headers->get('Transfer-Encoding') ?? '') == 'chunked')
	{
		$this->headers->delete('Transfer-Encoding');
	}
}