Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

Commit

Permalink
Allow 300-399 to be considered valid HTTP response codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronschmitz authored and LouisLandry committed Oct 12, 2012
1 parent a0d5793 commit 83b63f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libraries/joomla/oauth/oauth2client.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function auth()
$data['client_secret'] = $this->getOption('clientsecret'); $data['client_secret'] = $this->getOption('clientsecret');
$response = $this->http->post($this->getOption('tokenurl'), $data); $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') if ($response->headers['Content-Type'] == 'application/json')
Expand Down Expand Up @@ -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); $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 . '.'); throw new RuntimeException('Error code ' . $response->code . ' received requesting data: ' . $response->body . '.');
} }
Expand Down Expand Up @@ -321,7 +321,7 @@ public function refreshToken($token = null)
$data['client_secret'] = $this->getOption('clientsecret'); $data['client_secret'] = $this->getOption('clientsecret');
$response = $this->http->post($this->getOption('tokenurl'), $data); $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') if ($response->headers['Content-Type'] == 'application/json')
{ {
Expand Down

0 comments on commit 83b63f8

Please sign in to comment.