Skip to content

Commit

Permalink
Return 503 if auth server is unavailable
Browse files Browse the repository at this point in the history
Note this will only happen in EAS < 14.0. Newer versions will respond
with appropriate global status code.
  • Loading branch information
mrubinsk committed Oct 25, 2021
1 parent e847d23 commit 1d22372
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Horde/Rpc/ActiveSync.php
Expand Up @@ -238,6 +238,10 @@ protected function _handleError($e)
protected function _sendAuthenticationFailedHeaders($e)
{
switch ($e->getCode()) {
case constant('Horde_ActiveSync_Status::SERVER_ERROR_RETRY'):
$this->_logger->warn('Authentication server unavailable, sending 503 response.');
header('HTTP/1.1 503 Unavailable');
break;
case Horde_ActiveSync_Status::SYNC_NOT_ALLOWED:
case Horde_ActiveSync_Status::DEVICE_BLOCKED_FOR_USER:
$this->_logger->notice('Sending HTTP 403 Forbidden header response.');
Expand Down

0 comments on commit 1d22372

Please sign in to comment.