add content_length configuration

pull/433/head
juneszh 4 years ago committed by GitHub
parent c649964d95
commit ed9bbed287
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -33,6 +33,13 @@ class Response {
* @var bool HTTP response sent * @var bool HTTP response sent
*/ */
protected $sent = false; protected $sent = false;
/**
* header Content-Length
*
* @var boolean
*/
public $content_length = true;
/** /**
* @var array HTTP status codes * @var array HTTP status codes
@ -251,11 +258,13 @@ class Response {
} }
} }
// Send content length if ($this->content_length) {
$length = $this->getContentLength(); // Send content length
$length = $this->getContentLength();
if ($length > 0) { if ($length > 0) {
header('Content-Length: '.$length); header('Content-Length: '.$length);
}
} }
return $this; return $this;

Loading…
Cancel
Save