Ratelimit /followers and /following endpoints

This commit is contained in:
Alex Gleason 2024-12-27 13:16:33 -06:00
parent a316e92001
commit 54c398c5fa
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -229,8 +229,16 @@ app.post('/api/v1/accounts/:pubkey{[0-9a-f]{64}}/mute', requireSigner, muteContr
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('/api/v1/accounts/:pubkey{[0-9a-f]{64}}/follow', requireSigner, followController);
app.post('/api/v1/accounts/:pubkey{[0-9a-f]{64}}/unfollow', requireSigner, unfollowController); app.post('/api/v1/accounts/:pubkey{[0-9a-f]{64}}/unfollow', requireSigner, unfollowController);
app.get('/api/v1/accounts/:pubkey{[0-9a-f]{64}}/followers', followersController); app.get(
app.get('/api/v1/accounts/:pubkey{[0-9a-f]{64}}/following', followingController); '/api/v1/accounts/:pubkey{[0-9a-f]{64}}/followers',
rateLimitMiddleware(8, Time.seconds(30)),
followersController,
);
app.get(
'/api/v1/accounts/:pubkey{[0-9a-f]{64}}/following',
rateLimitMiddleware(8, Time.seconds(30)),
followingController,
);
app.get( app.get(
'/api/v1/accounts/:pubkey{[0-9a-f]{64}}/statuses', '/api/v1/accounts/:pubkey{[0-9a-f]{64}}/statuses',
rateLimitMiddleware(12, Time.seconds(30)), rateLimitMiddleware(12, Time.seconds(30)),