Skip to content

Commit

Permalink
Http\Response::setCode produces valid HTTP header on nginx (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes authored and dg committed Dec 19, 2016
1 parent 745ca79 commit 71602f2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ public function setCode($code)
}
self::checkHeaders();
$this->code = $code;
$protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1';
header($protocol . ' ' . $code, TRUE, $code);
http_response_code($code);
return $this;
}

Expand Down

0 comments on commit 71602f2

Please sign in to comment.