diff --git a/flight/net/Response.php b/flight/net/Response.php index 6a827e5..100c3a8 100644 --- a/flight/net/Response.php +++ b/flight/net/Response.php @@ -66,6 +66,7 @@ class Response { 415 => 'Unsupported Media Type', 416 => 'Requested Range Not Satisfiable', 417 => 'Expectation Failed', + 418 => 'Permanent Redirect', 500 => 'Internal Server Error', 501 => 'Not Implemented', @@ -82,7 +83,11 @@ class Response { * @return object Self reference * @throws \Exception If invalid status code */ - public function status($code) { + public function status($code = null) { + if ($code === null) { + return $this->status; + } + if (array_key_exists($code, self::$codes)) { $this->status = $code; }