Skip to content
Permalink
Browse files

Fixed HTTP status codes for non-redirects which were breaking AuthCom…

…ponent.
  • Loading branch information...
Phally committed May 4, 2012
1 parent ed1a64c commit 7bb56e7fc38a68993dc4158a54a255111d017a92
Showing with 11 additions and 11 deletions.
  1. +8 −9 lib/Cake/Controller/Controller.php
  2. +3 −2 lib/Cake/Test/Case/Controller/ControllerTest.php
@@ -531,7 +531,7 @@ protected function _getScaffold(CakeRequest $request) {
}
/**
* Merge components, helpers, and uses vars from
* Merge components, helpers, and uses vars from
* Controller::$_mergeParent and PluginAppController.
*
* @return void
@@ -770,18 +770,17 @@ public function redirect($url, $status = null, $exit = true) {
session_write_close();
}
if (!empty($status) && is_string($status)) {
$codes = array_flip($this->response->httpCodes());
if (isset($codes[$status])) {
$status = $codes[$status];
}
}
if ($url !== null) {
$this->response->header('Location', Router::url($url, true));
}
if (!empty($status) && ($status >= 300 && $status < 400)) {
if (!empty($status)) {
if (is_string($status)) {
$codes = array_flip($this->response->httpCodes());
if (isset($codes[$status])) {
$status = $codes[$status];
}
}
$this->response->statusCode($status);
}
@@ -387,7 +387,7 @@ class AnotherTestController extends ControllerTestAppController {
/**
* merge parent
*
*
* @var string
*/
protected $_mergeParent = 'ControllerTestAppController';
@@ -729,7 +729,8 @@ public static function statusCodeProvider() {
array(303, "See Other"),
array(304, "Not Modified"),
array(305, "Use Proxy"),
array(307, "Temporary Redirect")
array(307, "Temporary Redirect"),
array(403, "Forbidden"),
);
}

0 comments on commit 7bb56e7

Please sign in to comment.
You can’t perform that action at this time.