Skip to content

Commit

Permalink
Bug: 13894 Avoid returning invalid strings in HTTP response.
Browse files Browse the repository at this point in the history
Really no need to return the error message here anyway, just log it.
  • Loading branch information
mrubinsk committed Mar 3, 2015
1 parent cf62fc5 commit bb52fdb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions framework/Rpc/lib/Horde/Rpc/ActiveSync.php
Expand Up @@ -149,18 +149,21 @@ public function getResponse($request)
}
} catch (Horde_ActiveSync_Exception_InvalidRequest $e) {
$this->_logger->err(sprintf(
'Returning HTTP 400 while handling %s command', $this->_get['Cmd']));
'Returning HTTP 400 while handling %s command. Error is: %s',
$this->_get['Cmd'], $e->getMessage()));
$this->_handleError($e);
header('HTTP/1.1 400 Invalid Request ' . $e->getMessage());
header('HTTP/1.1 400 Invalid Request');
exit;
} catch (Horde_Exception_AuthenticationFailure $e) {
$this->_sendAuthenticationFailedHeaders();
exit;
} catch (Horde_Exception $e) {
$this->_logger->err(sprintf(
'Returning HTTP 500 while handling %s command.', $this->_get['Cmd']));
'Returning HTTP 500 while handling %s command. Error is: %s',
$this->_get['Cmd'],
$e->getMessage()));
$this->_handleError($e);
header('HTTP/1.1 500 ' . $e->getMessage());
header('HTTP/1.1 500');
exit;
}
break;
Expand Down

0 comments on commit bb52fdb

Please sign in to comment.