浏览代码

more semantically correct webfinger (use rel=self, allow type=ld+json)

a 2 年之前
父节点
当前提交
9471fa0078
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      app/Services/WebfingerService.php

+ 3 - 1
app/Services/WebfingerService.php

@@ -48,9 +48,11 @@ class WebfingerService
 		$link = collect($webfinger['links'])
 			->filter(function($link) {
 				return $link &&
+					isset($link['rel']) &&
 					isset($link['type']) &&
 					isset($link['href']) &&
-					$link['type'] == 'application/activity+json';
+					$link['rel'] == 'self' &&
+					$link['type'] == 'application/activity+json' || $link['type'] == 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"';
 			})
 			->pluck('href')
 			->first();