Skip to content

Commit 1ef844a

Browse files
committed
Rest Auth Config Change
I updated the 'rest_auth' variable by setting it to lower case to prevent any auth errors if you use capitalized or uppercase letters in that config item. Reason for change was due to documentation and unexpected errors.
1 parent cefa36a commit 1ef844a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

application/libraries/REST_Controller.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,11 @@ public function __construct()
213213
// When there is no specific override for the current class/method, use the default auth value set in the config
214214
if ($this->auth_override !== TRUE)
215215
{
216-
if ($this->config->item('rest_auth') == 'basic')
216+
if (strtolower( $this->config->item('rest_auth') ) == 'basic')
217217
{
218218
$this->_prepare_basic_auth();
219219
}
220-
elseif ($this->config->item('rest_auth') == 'digest')
220+
elseif (strtolower( $this->config->item('rest_auth') ) == 'digest')
221221
{
222222
$this->_prepare_digest_auth();
223223
}
@@ -1227,11 +1227,11 @@ protected function _check_whitelist_auth()
12271227
*/
12281228
protected function _force_login($nonce = '')
12291229
{
1230-
if ($this->config->item('rest_auth') == 'basic')
1230+
if (strtolower( $this->config->item('rest_auth') ) == 'basic')
12311231
{
12321232
header('WWW-Authenticate: Basic realm="'.$this->config->item('rest_realm').'"');
12331233
}
1234-
elseif ($this->config->item('rest_auth') == 'digest')
1234+
elseif (strtolower( $this->config->item('rest_auth') ) == 'digest')
12351235
{
12361236
header('WWW-Authenticate: Digest realm="'.$this->config->item('rest_realm').'", qop="auth", nonce="'.$nonce.'", opaque="'.md5($this->config->item('rest_realm')).'"');
12371237
}

0 commit comments

Comments
 (0)