booru / philomena

Next-generation imageboard software. This software development project is independent from any image hosting project.
GNU Affero General Public License v3.0
9 stars 10 forks source link

Add api rate limit #82

Closed SomewhatDamaged closed 4 years ago

SomewhatDamaged commented 4 years ago

Before you begin


This adds a 30s rate limit to the CREATE /api/v1/json/image endpoint. Note: seeing as this uses the limit_plug, anyone with staff Role will be exempt from it.

If you want to change the timeout, please see line 11 in image_controller.ex

basisbit commented 4 years ago

Thank you for this PR! Would this limit to one image per 30 seconds?

SomewhatDamaged commented 4 years ago

One access of the endpoint every 30 seconds, yeah.