mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Ratelimit follow and unfollow
This commit is contained in:
parent
54c398c5fa
commit
b85513496c
1 changed files with 12 additions and 2 deletions
14
src/app.ts
14
src/app.ts
|
|
@ -227,8 +227,18 @@ app.post('/api/v1/accounts/:pubkey{[0-9a-f]{64}}/block', requireSigner, blockCon
|
||||||
app.post('/api/v1/accounts/:pubkey{[0-9a-f]{64}}/unblock', requireSigner, unblockController);
|
app.post('/api/v1/accounts/:pubkey{[0-9a-f]{64}}/unblock', requireSigner, unblockController);
|
||||||
app.post('/api/v1/accounts/:pubkey{[0-9a-f]{64}}/mute', requireSigner, muteController);
|
app.post('/api/v1/accounts/:pubkey{[0-9a-f]{64}}/mute', requireSigner, muteController);
|
||||||
app.post('/api/v1/accounts/:pubkey{[0-9a-f]{64}}/unmute', requireSigner, unmuteController);
|
app.post('/api/v1/accounts/:pubkey{[0-9a-f]{64}}/unmute', requireSigner, unmuteController);
|
||||||
app.post('/api/v1/accounts/:pubkey{[0-9a-f]{64}}/follow', requireSigner, followController);
|
app.post(
|
||||||
app.post('/api/v1/accounts/:pubkey{[0-9a-f]{64}}/unfollow', requireSigner, unfollowController);
|
'/api/v1/accounts/:pubkey{[0-9a-f]{64}}/follow',
|
||||||
|
rateLimitMiddleware(2, Time.seconds(1)),
|
||||||
|
requireSigner,
|
||||||
|
followController,
|
||||||
|
);
|
||||||
|
app.post(
|
||||||
|
'/api/v1/accounts/:pubkey{[0-9a-f]{64}}/unfollow',
|
||||||
|
rateLimitMiddleware(2, Time.seconds(1)),
|
||||||
|
requireSigner,
|
||||||
|
unfollowController,
|
||||||
|
);
|
||||||
app.get(
|
app.get(
|
||||||
'/api/v1/accounts/:pubkey{[0-9a-f]{64}}/followers',
|
'/api/v1/accounts/:pubkey{[0-9a-f]{64}}/followers',
|
||||||
rateLimitMiddleware(8, Time.seconds(30)),
|
rateLimitMiddleware(8, Time.seconds(30)),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue