Skip to content

Commit dc5de38

Browse files
committed
Remove index check from actor dispatcher
1 parent 77d7ad5 commit dc5de38

File tree

2 files changed

+0
-22
lines changed

2 files changed

+0
-22
lines changed

src/dispatchers.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import { v4 as uuidv4 } from 'uuid';
2626
import type { AccountService } from './account/account.service';
2727
import { mapActorToExternalAccountData } from './account/utils';
2828
import { type ContextData, fedify } from './app';
29-
import { ACTOR_DEFAULT_HANDLE } from './constants';
3029
import { isFollowedByDefaultSiteAccount } from './helpers/activitypub/actor';
3130
import { getUserData } from './helpers/user';
3231
import { addToList } from './kv-helpers';
@@ -43,7 +42,6 @@ export const actorDispatcher = (
4342
ctx: RequestContext<ContextData>,
4443
handle: string,
4544
) {
46-
if (handle !== ACTOR_DEFAULT_HANDLE) return null;
4745
const site = await siteService.getSiteByHost(ctx.host);
4846
if (site === null) return null;
4947

src/dispatchers.unit.test.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,13 @@ import {
88
type RequestContext,
99
} from '@fedify/fedify';
1010
import {
11-
actorDispatcher,
1211
likedDispatcher,
1312
nodeInfoDispatcher,
1413
outboxDispatcher,
1514
} from './dispatchers';
1615

17-
import type { AccountService } from './account/account.service';
1816
import { ACTOR_DEFAULT_HANDLE } from './constants';
1917
import * as lookupHelpers from './lookup-helpers';
20-
import type { SiteService } from './site/site.service';
2118

2219
vi.mock('./app', () => ({
2320
fedify: {
@@ -26,23 +23,6 @@ vi.mock('./app', () => ({
2623
}));
2724

2825
describe('dispatchers', () => {
29-
describe('actorDispatcher', () => {
30-
it(`returns null if the handle is not "${ACTOR_DEFAULT_HANDLE}"`, async () => {
31-
// TODO: Clean up the any type
32-
// biome-ignore lint/suspicious/noExplicitAny: Legacy code needs proper typing
33-
const ctx = {} as RequestContext<any>;
34-
const handle = 'anything';
35-
36-
const actual = await actorDispatcher(
37-
{} as unknown as SiteService,
38-
{} as unknown as AccountService,
39-
)(ctx, handle);
40-
const expected = null;
41-
42-
expect(actual).toEqual(expected);
43-
});
44-
});
45-
4626
describe('likedDispatcher', () => {
4727
// TODO: Clean up the any type
4828
// biome-ignore lint/suspicious/noExplicitAny: Legacy code needs proper typing

0 commit comments

Comments
 (0)