Commit 48120ce4 authored by Taylor Otwell's avatar Taylor Otwell

refactoring the response class.

parent 60c317ca
......@@ -121,10 +121,7 @@ class Response {
*/
public static function prepare($response)
{
if ($response instanceof Redirect)
{
$response = $response->response;
}
if ($response instanceof Redirect) $response = $response->response;
return ( ! $response instanceof Response) ? new static($response) : $response;
}
......@@ -136,15 +133,9 @@ class Response {
*/
public function send()
{
if ( ! array_key_exists('Content-Type', $this->headers))
{
$this->header('Content-Type', 'text/html; charset=utf-8');
}
if ( ! array_key_exists('Content-Type', $this->headers)) $this->header('Content-Type', 'text/html; charset=utf-8')
if ( ! headers_sent())
{
$this->send_headers();
}
if ( ! headers_sent()) $this->send_headers();
echo (string) $this->content;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment