git.cweiske.de
/
shpub.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ef34a25
)
check status code on access token fetch
author
Christian Weiske
<
[email protected]
>
Wed, 7 Sep 2016 20:50:08 +0000
(22:50 +0200)
committer
Christian Weiske
<
[email protected]
>
Wed, 7 Sep 2016 20:50:08 +0000
(22:50 +0200)
src/shpub/Command/Connect.php
patch
|
blob
|
history
diff --git
a/src/shpub/Command/Connect.php
b/src/shpub/Command/Connect.php
index 68a4e18e354e26c372e69ab789a9e6e499a2f7ab..02f60c7ae6a456a101c8b3cbbef5326596ffbc90 100644
(file)
--- a/
src/shpub/Command/Connect.php
+++ b/
src/shpub/Command/Connect.php
@@
-98,6
+98,12
@@
class Command_Connect
)
);
$res = $req->send();
+ if (intval($res->getStatus() / 100) !== 2) {
+ Log::err('Failed to fetch access token');
+ Log::err('Server responded with HTTP status code ' . $res->getStatus());
+ Log::err($res->getBody());
+ exit(2);
+ }
if ($res->getHeader('content-type') != 'application/x-www-form-urlencoded') {
Log::err('Wrong content type in auth verification response');
exit(2);