Skip to content

Commit 71602f2

Browse files
ondrejmirtesdg
authored andcommitted
Http\Response::setCode produces valid HTTP header on nginx (#113)
1 parent 745ca79 commit 71602f2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Http/Response.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ public function setCode($code)
6666
}
6767
self::checkHeaders();
6868
$this->code = $code;
69-
$protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1';
70-
header($protocol . ' ' . $code, TRUE, $code);
69+
http_response_code($code);
7170
return $this;
7271
}
7372

0 commit comments

Comments
 (0)