Return 404 on resource-not-found for WebFinger

This commit is contained in:
Mikael Nordfeldth 2014-06-04 12:46:06 +02:00
parent d350a20e1f
commit 6d0ac21185

View File

@ -40,15 +40,15 @@ class WebfingerAction extends XrdAction
Event::handle('EndGetWebFingerResource', array($this->resource, &$this->target, $this->args)); Event::handle('EndGetWebFingerResource', array($this->resource, &$this->target, $this->args));
} }
if (!$this->target instanceof WebFingerResource) {
throw new ServerException('Resource not found in local database.', 404);
}
return true; return true;
} }
protected function setXRD() protected function setXRD()
{ {
if (!($this->target instanceof WebFingerResource)) {
throw new Exception(_('Target not set for resource descriptor'));
}
$this->xrd->subject = $this->resource; $this->xrd->subject = $this->resource;
foreach ($this->target->getAliases() as $alias) { foreach ($this->target->getAliases() as $alias) {