Provide content-length header if response has a body

pull/165/head
everflux 10 years ago
parent 7c50eb7cfb
commit 268cf0cb66

@ -191,7 +191,6 @@ class Response {
$this->headers['Expires'] = gmdate('D, d M Y H:i:s', $expires) . ' GMT';
$this->headers['Cache-Control'] = 'max-age='.($expires - time());
}
return $this;
}
@ -236,6 +235,11 @@ class Response {
}
}
// Send content length
if( ($length = strlen($this->body)) > 0) {
header("Content-Length: $length");
}
return $this;
}

Loading…
Cancel
Save