|
|
|
@ -341,6 +341,15 @@ class Response
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($this->content_length === true) {
|
|
|
|
|
// Send content length
|
|
|
|
|
$length = $this->getContentLength();
|
|
|
|
|
|
|
|
|
|
if ($length > 0) {
|
|
|
|
|
$this->setHeader('Content-Length', (string) $length);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Send other headers
|
|
|
|
|
foreach ($this->headers as $field => $value) {
|
|
|
|
|
if (\is_array($value)) {
|
|
|
|
@ -352,15 +361,6 @@ class Response
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($this->content_length) {
|
|
|
|
|
// Send content length
|
|
|
|
|
$length = $this->getContentLength();
|
|
|
|
|
|
|
|
|
|
if ($length > 0) {
|
|
|
|
|
$this->setRealHeader('Content-Length: ' . $length);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -437,7 +437,7 @@ class Response
|
|
|
|
|
$this->processResponseCallbacks();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!headers_sent()) {
|
|
|
|
|
if (headers_sent() === false) {
|
|
|
|
|
$this->sendHeaders(); // @codeCoverageIgnore
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|