Unverified Commit c47b7e4d authored by Hong Minhee's avatar Hong Minhee
Browse files

Fix an interop issue of lookupObject()

parent 4751d9a7
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -80,6 +80,11 @@ To be released.
 -  Fixed a bug where the authenticated document loader had thrown `InvalidUrl`
    error when the URL redirection was involved in Bun.

 -  Fixed a bug of `lookupObject()` that it had failed to look up the actor
    object when WebFinger response had no links with
    `"type": "application/activity+json"` but had `"type":
    "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\""`.

[@fedify/cli]: https://jsr.io/@fedify/cli
[releases]: https://github.com/dahlia/fedify/releases
[FEP-8fcf]: https://codeberg.org/fediverse/fep/src/branch/main/fep/8fcf/fep-8fcf.md
+6 −1
Original line number Diff line number Diff line
@@ -81,7 +81,12 @@ export async function lookupObject(
    const jrd = await lookupWebFinger(identifier);
    if (jrd?.links == null) return null;
    for (const l of jrd.links) {
      if (l.type !== "application/activity+json" || l.rel !== "self") continue;
      if (
        l.type !== "application/activity+json" &&
          !l.type?.match(
            /application\/ld\+json;\s*profile="https:\/\/www.w3.org\/ns\/activitystreams"/,
          ) || l.rel !== "self"
      ) continue;
      try {
        const remoteDoc = await documentLoader(l.href);
        document = remoteDoc.document;