Merge pull request #165 from everflux/master

Provide content-length header if response has a body
pull/172/head
Mike Cao 10 years ago
commit f28d7eed46

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

Loading…
Cancel
Save