diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-01-09 00:43:52 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-01-09 09:21:35 +0100 |
commit | fbc77eb648bda9add4634c08dbb6af48c3670b5d (patch) | |
tree | cb2c32e33031490027210cf7e29cc98b519b2f83 /server/controllers/activitypub/outbox.ts | |
parent | c08579e14fe712cb2264a25daea956e682574335 (diff) | |
download | PeerTube-fbc77eb648bda9add4634c08dbb6af48c3670b5d.tar.gz PeerTube-fbc77eb648bda9add4634c08dbb6af48c3670b5d.tar.zst PeerTube-fbc77eb648bda9add4634c08dbb6af48c3670b5d.zip |
Add outbox page size parameter
Diffstat (limited to 'server/controllers/activitypub/outbox.ts')
-rw-r--r-- | server/controllers/activitypub/outbox.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/server/controllers/activitypub/outbox.ts b/server/controllers/activitypub/outbox.ts index f3dd2ad7d..916a110a8 100644 --- a/server/controllers/activitypub/outbox.ts +++ b/server/controllers/activitypub/outbox.ts | |||
@@ -9,15 +9,18 @@ import { asyncMiddleware, localAccountValidator, localVideoChannelValidator } fr | |||
9 | import { VideoModel } from '../../models/video/video' | 9 | import { VideoModel } from '../../models/video/video' |
10 | import { activityPubResponse } from './utils' | 10 | import { activityPubResponse } from './utils' |
11 | import { MActorLight } from '@server/typings/models' | 11 | import { MActorLight } from '@server/typings/models' |
12 | import { apPaginationValidator } from '../../middlewares/validators/activitypub' | ||
12 | 13 | ||
13 | const outboxRouter = express.Router() | 14 | const outboxRouter = express.Router() |
14 | 15 | ||
15 | outboxRouter.get('/accounts/:name/outbox', | 16 | outboxRouter.get('/accounts/:name/outbox', |
17 | apPaginationValidator, | ||
16 | localAccountValidator, | 18 | localAccountValidator, |
17 | asyncMiddleware(outboxController) | 19 | asyncMiddleware(outboxController) |
18 | ) | 20 | ) |
19 | 21 | ||
20 | outboxRouter.get('/video-channels/:name/outbox', | 22 | outboxRouter.get('/video-channels/:name/outbox', |
23 | apPaginationValidator, | ||
21 | localVideoChannelValidator, | 24 | localVideoChannelValidator, |
22 | asyncMiddleware(outboxController) | 25 | asyncMiddleware(outboxController) |
23 | ) | 26 | ) |
@@ -38,7 +41,7 @@ async function outboxController (req: express.Request, res: express.Response) { | |||
38 | logger.info('Receiving outbox request for %s.', actorOutboxUrl) | 41 | logger.info('Receiving outbox request for %s.', actorOutboxUrl) |
39 | 42 | ||
40 | const handler = (start: number, count: number) => buildActivities(actor, start, count) | 43 | const handler = (start: number, count: number) => buildActivities(actor, start, count) |
41 | const json = await activityPubCollectionPagination(actorOutboxUrl, handler, req.query.page) | 44 | const json = await activityPubCollectionPagination(actorOutboxUrl, handler, req.query.page, req.query.size) |
42 | 45 | ||
43 | return activityPubResponse(activityPubContextify(json), res) | 46 | return activityPubResponse(activityPubContextify(json), res) |
44 | } | 47 | } |