From 6d0ac21185f8827d530f5f55c49aeebd833e4602 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Wed, 4 Jun 2014 12:46:06 +0200 Subject: [PATCH] Return 404 on resource-not-found for WebFinger --- plugins/WebFinger/actions/webfinger.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/WebFinger/actions/webfinger.php b/plugins/WebFinger/actions/webfinger.php index 92ab124147..d02eaa46d9 100644 --- a/plugins/WebFinger/actions/webfinger.php +++ b/plugins/WebFinger/actions/webfinger.php @@ -40,15 +40,15 @@ class WebfingerAction extends XrdAction 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; } protected function setXRD() { - if (!($this->target instanceof WebFingerResource)) { - throw new Exception(_('Target not set for resource descriptor')); - } - $this->xrd->subject = $this->resource; foreach ($this->target->getAliases() as $alias) {