Unverified Commit 8c8c4775 authored by Hong Minhee (洪 民憙)'s avatar Hong Minhee (洪 民憙) Committed by GitHub
Browse files

Merge pull request #101 from allouis/fix-inbox-path-check

parents 4a25550c b91a16f4
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -8,6 +8,12 @@ Version 0.11.3

To be released.

 -  Fixed a bug where use of `Federation.setInboxDispatcher()` after
    `Federation.setInboxListeners()` had caused a `RouterError` to be
    thrown even if the paths match.  [[#101] by Fabien O'Carroll]

[#101]: https://github.com/dahlia/fedify/pull/101


Version 0.11.2
--------------
+12 −0
Original line number Diff line number Diff line
@@ -745,6 +745,18 @@ test("Federation.setInboxDispatcher()", async (t) => {
    );
  });

  await t.step("path match", () => {
    const federation = createFederation<void>({
      kv,
      documentLoader: mockDocumentLoader,
    });
    federation.setInboxListeners("/users/{handle}/inbox");
    federation.setInboxDispatcher(
      "/users/{handle}/inbox",
      () => ({ items: [] }),
    );
  });

  await t.step("wrong variables in path", () => {
    const federation = createFederation<void>({
      kv,
+1 −0
Original line number Diff line number Diff line
@@ -1351,6 +1351,7 @@ export class Federation<TContextData> {
          "Path for inbox must have one variable: {handle}",
        );
      }
      this.#inboxPath = inboxPath;
    }
    if (sharedInboxPath != null) {
      const siVars = this.#router.add(sharedInboxPath, "sharedInbox");