diff options
| author | Freya Murphy <freya@freyacat.org> | 2026-03-02 16:05:12 -0500 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2026-03-02 18:39:22 -0500 |
| commit | 24734d408700a72d45c3ff4a679606cab3ec544f (patch) | |
| tree | d0fee0bcf508f3c631f7c26724bb5cd94dfc88a0 /packages/backend/src/server/ActivityPubServerService.ts | |
| parent | merge: Release/2025.4.5 (!1258) (diff) | |
| download | sharkey-stable.tar.gz sharkey-stable.tar.bz2 sharkey-stable.zip | |
split url into webUrl and localUrl (like mastodon)stable
Diffstat (limited to '')
| -rw-r--r-- | packages/backend/src/server/ActivityPubServerService.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/backend/src/server/ActivityPubServerService.ts b/packages/backend/src/server/ActivityPubServerService.ts index 27d25d2152..9a8309b41c 100644 --- a/packages/backend/src/server/ActivityPubServerService.ts +++ b/packages/backend/src/server/ActivityPubServerService.ts @@ -114,7 +114,7 @@ export class ActivityPubServerService { private async packActivity(note: MiNote, author: MiUser): Promise<ICreate | IAnnounce> { if (isRenote(note) && !isQuote(note)) { const renote = await this.notesRepository.findOneByOrFail({ id: note.renoteId }); - return this.apRendererService.renderAnnounce(renote.uri ? renote.uri : `${this.config.url}/notes/${renote.id}`, note); + return this.apRendererService.renderAnnounce(renote.uri ? renote.uri : `${this.config.webUrl}/notes/${renote.id}`, note); } return this.apRendererService.renderCreate(await this.apRendererService.renderNote(note, author, false), note); @@ -196,7 +196,7 @@ export class ActivityPubServerService { const logPrefix = `${request.id} ${request.url} (by ${request.headers['user-agent']}) claims to be from ${keyHost}:`; - if (signature.params.headers.indexOf('host') === -1 || request.headers.host !== this.config.host) { + if (signature.params.headers.indexOf('host') === -1 || (request.headers.host !== this.config.localHost && request.headers.host !== this.config.webHost)) { // no destination host, or not us: refuse return `${logPrefix} no destination host, or not us: refuse`; } @@ -292,7 +292,7 @@ export class ActivityPubServerService { } if (signature.params.headers.indexOf('host') === -1 - || request.headers.host !== this.config.host) { + || (request.headers.host !== this.config.localHost && request.headers.host !== this.config.webHost)) { // Host not specified or not match. reply.code(401); return; @@ -394,7 +394,7 @@ export class ActivityPubServerService { //#endregion const limit = 10; - const partOf = `${this.config.url}/users/${userId}/followers`; + const partOf = `${this.config.webUrl}/users/${userId}/followers`; if (page) { const query = { @@ -491,7 +491,7 @@ export class ActivityPubServerService { //#endregion const limit = 10; - const partOf = `${this.config.url}/users/${userId}/following`; + const partOf = `${this.config.webUrl}/users/${userId}/following`; if (page) { const query = { @@ -576,7 +576,7 @@ export class ActivityPubServerService { const renderedNotes = await Promise.all(pinnedNotes.map(note => this.apRendererService.renderNote(note, user))); const rendered = this.apRendererService.renderOrderedCollection( - `${this.config.url}/users/${userId}/collections/featured`, + `${this.config.webUrl}/users/${userId}/collections/featured`, renderedNotes.length, undefined, undefined, @@ -635,7 +635,7 @@ export class ActivityPubServerService { } const limit = 20; - const partOf = `${this.config.url}/users/${userId}/outbox`; + const partOf = `${this.config.webUrl}/users/${userId}/outbox`; if (page) { const notes = this.meta.enableFanoutTimeline ? await this.fanoutTimelineEndpointService.getMiNotes({ |