This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

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

  • Loading branch information...
aaronschmitz authored and LouisLandry committed Jul 31, 2012
1 parent a0d5793 commit 83b63f829decce26bf90d237ee40302cfb40d2db
Showing with 3 additions and 3 deletions.
  1. +3 −3 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 83b63f8

Please sign in to comment.