parent
7119b48cee
commit
145c15f0d9
2 changed files with 8 additions and 0 deletions
|
@ -3,6 +3,7 @@ import fastifyAccepts from '@fastify/accepts';
|
|||
import httpSignature from '@peertube/http-signature';
|
||||
import { Brackets, In, IsNull, LessThan, Not } from 'typeorm';
|
||||
import accepts from 'accepts';
|
||||
import vary from 'vary';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import type { FollowingsRepository, NotesRepository, EmojisRepository, NoteReactionsRepository, UserProfilesRepository, UserNotePiningsRepository, UsersRepository } from '@/models/index.js';
|
||||
import * as url from '@/misc/prelude/url.js';
|
||||
|
@ -443,6 +444,8 @@ export class ActivityPubServerService {
|
|||
|
||||
// note
|
||||
fastify.get<{ Params: { note: string; } }>('/notes/:note', { constraints: { apOrHtml: 'ap' } }, async (request, reply) => {
|
||||
vary(reply.raw, 'Accept');
|
||||
|
||||
const note = await this.notesRepository.findOneBy({
|
||||
id: request.params.note,
|
||||
visibility: In(['public', 'home']),
|
||||
|
@ -471,6 +474,8 @@ export class ActivityPubServerService {
|
|||
|
||||
// note activity
|
||||
fastify.get<{ Params: { note: string; } }>('/notes/:note/activity', async (request, reply) => {
|
||||
vary(reply.raw, 'Accept');
|
||||
|
||||
const note = await this.notesRepository.findOneBy({
|
||||
id: request.params.note,
|
||||
userHost: IsNull(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue