Fixed reading redirect location

This commit is contained in:
aymm 2021-03-11 16:29:56 +00:00
parent 52b85b533b
commit 75200da1bc

View File

@ -531,7 +531,7 @@ class APnutI
try { try {
$r = $this->get('/users/'.$user_id.'/avatar', $args, 'application/json', false); $r = $this->get('/users/'.$user_id.'/avatar', $args, 'application/json', false);
} catch (HttpPnutRedirectException $re) { } catch (HttpPnutRedirectException $re) {
return $re->getMessage(); return $re->response;
} }
$this->logger->error('Could not fetch avatar: No redirection! ' . json_encode($r)); $this->logger->error('Could not fetch avatar: No redirection! ' . json_encode($r));
throw new PnutException('Could not fetch avatar: No redirection!'); throw new PnutException('Could not fetch avatar: No redirection!');