]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/activitypub/outbox.ts
Merge branch 'release/3.2.0' into develop
[github/Chocobozzz/PeerTube.git] / server / controllers / activitypub / outbox.ts
index f3dd2ad7d3e5fed8e1be89003813054cde20a24b..22328da7f3207e415fabe4c0504b27cc91dcc156 100644 (file)
@@ -8,16 +8,19 @@ import { buildAudience } from '../../lib/activitypub/audience'
 import { asyncMiddleware, localAccountValidator, localVideoChannelValidator } from '../../middlewares'
 import { VideoModel } from '../../models/video/video'
 import { activityPubResponse } from './utils'
-import { MActorLight } from '@server/typings/models'
+import { MActorLight } from '@server/types/models'
+import { apPaginationValidator } from '../../middlewares/validators/activitypub'
 
 const outboxRouter = express.Router()
 
 outboxRouter.get('/accounts/:name/outbox',
+  apPaginationValidator,
   localAccountValidator,
   asyncMiddleware(outboxController)
 )
 
 outboxRouter.get('/video-channels/:name/outbox',
+  apPaginationValidator,
   localVideoChannelValidator,
   asyncMiddleware(outboxController)
 )
@@ -38,7 +41,7 @@ async function outboxController (req: express.Request, res: express.Response) {
   logger.info('Receiving outbox request for %s.', actorOutboxUrl)
 
   const handler = (start: number, count: number) => buildActivities(actor, start, count)
-  const json = await activityPubCollectionPagination(actorOutboxUrl, handler, req.query.page)
+  const json = await activityPubCollectionPagination(actorOutboxUrl, handler, req.query.page, req.query.size)
 
   return activityPubResponse(activityPubContextify(json), res)
 }