1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Issue #2638 - zlib compression content length.

This commit is contained in:
Cameron 2017-05-16 14:31:23 -07:00
parent 382d92f9a8
commit 3e88c01261

View File

@ -2503,7 +2503,7 @@ class e_http_header
if($this->compression_server_support == true && $this->compression_browser_support == true)
{
$this->compress_output = varset(e107::getPref('compress_output'),false);
$this->compress_output = (bool) varset(e107::getPref('compress_output'),false);
}
else
{
@ -2594,7 +2594,7 @@ class e_http_header
$text .=print_a($server,true);
if($this->compress_output == true)
if($this->compress_output === true)
{
$text = gzencode($text, $this->compression_level);
@ -2642,28 +2642,18 @@ class e_http_header
}
if($this->compress_output != false)
if($this->compress_output !== false)
{
// $this->setHeader("ETag: \"{$this->etag}-gzip\"");
$this->setHeader('ETag: "'.$this->etag.'-gzip"', true);
$this->setHeader('ETag: "'.$this->etag.'-gzip"', true);
$this->content = gzencode($this->content, $this->compression_level);
$this->length = strlen($this->content);
$this->setHeader('Content-Encoding: gzip', true);
$this->setHeader("Content-Length: ".$this->length, true);
}
else
{
/*
if($this->compression_browser_support ==true)
{
$this->setHeader('ETag: "'.$this->etag.'-gzip"', true);
}
else
{*/
$this->setHeader('ETag: "'.$this->etag.'"', true);
// }
$this->setHeader('ETag: "'.$this->etag.'"', true);
$this->setHeader("Content-Length: ".$this->length, true);
}