summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvioloncello.ch <22591354+violoncelloCH@users.noreply.github.com>2019-02-01 17:18:02 +0100
committerGitHub <noreply@github.com>2019-02-01 17:18:02 +0100
commit4d89c4334e35c0c5548befb179ced85dcfa11b1f (patch)
tree44248e8b8b416767b90e816ab7b5b944cac502b3
parentf3bac3b50e421f097aca0827461b15a13ecb24c4 (diff)
parent18145ed5ebfa3d6ea6c21e56b439b78c2cccdedc (diff)
Merge pull request #389 from nextcloud/backport/388/alpha1
[alpha1] custom apps folder and webfinger
-rw-r--r--lib/Service/ConfigService.php11
-rw-r--r--lib/webfinger.php7
2 files changed, 12 insertions, 6 deletions
diff --git a/lib/Service/ConfigService.php b/lib/Service/ConfigService.php
index 7e4c04e1..4236b9de 100644
--- a/lib/Service/ConfigService.php
+++ b/lib/Service/ConfigService.php
@@ -242,6 +242,7 @@ class ConfigService {
return $this->config->getSystemValue($key, '');
}
+
/**
* @param string $cloudAddress
*/
@@ -277,13 +278,17 @@ class ConfigService {
/**
- * // TODO - check the Apps folder
+ * @param string $path
*
* @return string
* @throws SocialAppConfigException
*/
- public function getUrlSocial(): string {
- return $this->getCloudAddress() . '/apps/social/';
+ public function getUrlSocial(string $path = ''): string {
+ if ($path === '') {
+ $path = $this->urlGenerator->linkToRoute('social.Navigation.navigate');
+ }
+
+ return 'https://' . $this->getCloudAddress(true) . $path;
}
diff --git a/lib/webfinger.php b/lib/webfinger.php
index 7d8f1fe0..8a50b82c 100644
--- a/lib/webfinger.php
+++ b/lib/webfinger.php
@@ -68,8 +68,9 @@ try {
exit;
}
-$href =
- $urlGenerator->linkToRouteAbsolute('social.ActivityPub.actorAlias', ['username' => $username]);
+$href = $configService->getUrlSocial(
+ $urlGenerator->linkToRoute('social.ActivityPub.actorAlias', ['username' => $username])
+);
if (substr($href, -1) === '/') {
$href = substr($href, 0, -1);
@@ -79,7 +80,7 @@ $finger = [
'subject' => $subject,
'links' => [
[
- 'rel' => 'self',
+ 'rel' => 'self',
'type' => 'application/activity+json',
'href' => $href
]