Browse files

Allow 300-399 to be considered valid HTTP response codes.

  • Loading branch information...
1 parent f70bc5b commit 31eed8dd04d8800ec5350e31e37b47ccfe43f642 @aaronschmitz committed Jul 31, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 libraries/joomla/oauth/oauth2client.php
View
6 libraries/joomla/oauth/oauth2client.php
@@ -78,7 +78,7 @@ public function auth()
$data['client_secret'] = $this->getOption('clientsecret');
$response = $this->http->post($this->getOption('tokenurl'), $data);
- if ($response->code >= 200 && $response->code < 300)
+ if ($response->code >= 200 && $response->code < 400)
{
if ($response->headers['Content-Type'] == 'application/json')
@@ -220,7 +220,7 @@ public function query($url, $data = null, $headers = array(), $method = 'get', $
$response = $this->client->request($method, new JURI($url), $data, $headers, $timeout);
- if ($response->code < 200 || $response->code >= 300)
+ if ($response->code < 200 || $response->code >= 400)
{
throw new RuntimeException('Error code ' . $response->code . ' received requesting data: ' . $response->body . '.');
}
@@ -321,7 +321,7 @@ public function refreshToken($token = null)
$data['client_secret'] = $this->getOption('clientsecret');
$response = $this->http->post($this->getOption('tokenurl'), $data);
- if ($response->code >= 200 || $response->code < 300)
+ if ($response->code >= 200 || $response->code < 400)
{
if ($response->headers['Content-Type'] == 'application/json')
{

0 comments on commit 31eed8d

Please sign in to comment.