diff --git a/bun.lockb b/bun.lockb index 04dce4ce..3e4fe997 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index e4682b82..c8206fbd 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "@json2csv/plainjs": "^7.0.6", "@logtape/logtape": "npm:@jsr/logtape__logtape@0.4.2", "@lysand-org/client": "^0.2.4", - "@lysand-org/federation": "^2.1.2", + "@lysand-org/federation": "^2.1.3", "@oclif/core": "^4.0.12", "@tufjs/canonical-json": "^2.0.0", "altcha-lib": "^0.4.0", diff --git a/server/api/well-known/webfinger/index.ts b/server/api/well-known/webfinger/index.ts index b295a6cf..b5746f76 100644 --- a/server/api/well-known/webfinger/index.ts +++ b/server/api/well-known/webfinger/index.ts @@ -96,6 +96,7 @@ export default (app: Hono) => activityPubUrl = await manager.webFinger( user.data.username, new URL(config.http.base_url).host, + "application/activity+json", ); } catch (e) { const error = e as ResponseError; @@ -111,6 +112,13 @@ export default (app: Hono) => }@${host}`, links: [ + // Keep the ActivityPub link first, because Misskey only searches + // for the first link with rel="self" and doesn't check the type. + activityPubUrl && { + rel: "self", + type: "application/activity+json", + href: activityPubUrl, + }, { rel: "self", type: "application/json", @@ -119,11 +127,6 @@ export default (app: Hono) => config.http.base_url, ).toString(), }, - activityPubUrl && { - rel: "self", - type: "application/activity+json", - href: activityPubUrl, - }, { rel: "avatar", type: lookup(user.getAvatarUrl(config)),