mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 12:20:44 +02:00
Issue #2638 - zlib compression content length.
This commit is contained in:
22
class2.php
22
class2.php
@@ -2503,7 +2503,7 @@ class e_http_header
|
|||||||
|
|
||||||
if($this->compression_server_support == true && $this->compression_browser_support == true)
|
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
|
else
|
||||||
{
|
{
|
||||||
@@ -2594,7 +2594,7 @@ class e_http_header
|
|||||||
|
|
||||||
$text .=print_a($server,true);
|
$text .=print_a($server,true);
|
||||||
|
|
||||||
if($this->compress_output == true)
|
if($this->compress_output === true)
|
||||||
{
|
{
|
||||||
|
|
||||||
$text = gzencode($text, $this->compression_level);
|
$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->content = gzencode($this->content, $this->compression_level);
|
||||||
|
$this->length = strlen($this->content);
|
||||||
$this->setHeader('Content-Encoding: gzip', true);
|
$this->setHeader('Content-Encoding: gzip', true);
|
||||||
$this->setHeader("Content-Length: ".$this->length, true);
|
$this->setHeader("Content-Length: ".$this->length, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
$this->setHeader('ETag: "'.$this->etag.'"', true);
|
||||||
if($this->compression_browser_support ==true)
|
|
||||||
{
|
|
||||||
$this->setHeader('ETag: "'.$this->etag.'-gzip"', true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{*/
|
|
||||||
$this->setHeader('ETag: "'.$this->etag.'"', true);
|
|
||||||
// }
|
|
||||||
|
|
||||||
$this->setHeader("Content-Length: ".$this->length, true);
|
$this->setHeader("Content-Length: ".$this->length, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user