Skip to content

Commit 7c1848d

Browse files
Merge pull request #256 from jtrainaldi/master
Rest Auth Config Change
2 parents 3407709 + 1ef844a commit 7c1848d

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
@@ -258,11 +258,11 @@ public function __construct()
258258
// When there is no specific override for the current class/method, use the default auth value set in the config
259259
if ($this->auth_override !== TRUE)
260260
{
261-
if ($this->config->item('rest_auth') == 'basic')
261+
if (strtolower( $this->config->item('rest_auth') ) == 'basic')
262262
{
263263
$this->_prepare_basic_auth();
264264
}
265-
elseif ($this->config->item('rest_auth') == 'digest')
265+
elseif (strtolower( $this->config->item('rest_auth') ) == 'digest')
266266
{
267267
$this->_prepare_digest_auth();
268268
}
@@ -1396,11 +1396,11 @@ protected function _check_whitelist_auth()
13961396
*/
13971397
protected function _force_login($nonce = '')
13981398
{
1399-
if ($this->config->item('rest_auth') == 'basic')
1399+
if (strtolower( $this->config->item('rest_auth') ) == 'basic')
14001400
{
14011401
header('WWW-Authenticate: Basic realm="'.$this->config->item('rest_realm').'"');
14021402
}
1403-
elseif ($this->config->item('rest_auth') == 'digest')
1403+
elseif (strtolower( $this->config->item('rest_auth') ) == 'digest')
14041404
{
14051405
header('WWW-Authenticate: Digest realm="'.$this->config->item('rest_realm').'", qop="auth", nonce="'.$nonce.'", opaque="'.md5($this->config->item('rest_realm')).'"');
14061406
}

0 commit comments

Comments
 (0)