Skip to content

Commit

Permalink
monitoring: Fix HTTP response code when showing an invalid host
Browse files Browse the repository at this point in the history
refs #6281
  • Loading branch information
lippserd committed May 21, 2015
1 parent e8c704b commit 0b81a11
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions modules/monitoring/application/controllers/HostController.php
Expand Up @@ -21,17 +21,15 @@ class Monitoring_HostController extends MonitoredObjectController

/**
* Fetch the requested host from the monitoring backend
*
* @throws Zend_Controller_Action_Exception If the host was not found
*/
public function init()
{
$host = new Host($this->backend, $this->params->get('host'));
$host = new Host($this->backend, $this->params->getRequired('host'));

$this->applyRestriction('monitoring/hosts/filter', $host);

if ($host->fetch() === false) {
throw new Zend_Controller_Action_Exception($this->translate('Host not found'));
$this->httpNotFound($this->translate('Host not found'));
}
$this->object = $host;
$this->createTabs();
Expand Down

0 comments on commit 0b81a11

Please sign in to comment.