Fixed redirects
This commit is contained in:
parent
c938ede0a2
commit
7264b523a6
@ -158,7 +158,7 @@ class APnutI
|
||||
break;
|
||||
case 'location':
|
||||
case 'Location':
|
||||
$this->redirectTarget = $v;
|
||||
$this->redirect_target = $v;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -230,6 +230,9 @@ class APnutI
|
||||
$response = $this->parseHeaders($response);
|
||||
if (!empty($response)) {
|
||||
$response = json_decode($response, true);
|
||||
if ($response === null && !empty($this->redirect_target)) {
|
||||
throw new HttpPnutRedirectException($this->redirect_target);
|
||||
}
|
||||
try {
|
||||
$this->meta = new Meta($response);
|
||||
} catch (NotAuthorizedException $nae) {
|
||||
|
Loading…
Reference in New Issue
Block a user