Commit 248e0cb9 by Qiang Xue

Added default status code setting.

parent 02c0bfcb
......@@ -249,6 +249,9 @@ class Response extends \yii\base\Response
*/
public function setStatusCode($value, $text = null)
{
if ($value === null) {
$value = 200;
}
$this->_statusCode = (int)$value;
if ($this->getIsInvalid()) {
throw new InvalidParamException("The HTTP status code is invalid: $value");
......
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