Skip to content

Commit

Permalink
Tweaked AspectAuth
Browse files Browse the repository at this point in the history
  • Loading branch information
hirak committed Feb 7, 2016
1 parent 650cf12 commit 2e8947f
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/Aspects/AspectAuth.php
Expand Up @@ -54,16 +54,9 @@ private function after(HttpGetResponse $res)
throw new Downloader\TransportException("$res->error:$res->errno");
}

switch ($res->info['http_code']) {
case 200: //OK
return;
case 401: //Unauthorized
case 403: //Forbidden
case 404: //Not Found
$res->setNeedAuth();
break;
case 407: //Proxy Authentication Required
break;
if (in_array($res->info['http_code'], array(401, 403, 404))) {
$res->setNeedAuth();
return;
}
}
}

0 comments on commit 2e8947f

Please sign in to comment.