librariesio / libraries.io

:books: The Open Source Discovery Service
https://libraries.io
GNU Affero General Public License v3.0
1.1k stars 206 forks source link

Replace non-working rack-attack-rate-limit gem with a responder #3277

Closed tiegz closed 6 months ago

tiegz commented 6 months ago

libraries was using a rack-attack-rate-limit gem that hasn't been updated in 9 years and doesn't seem to add the headers that it should. This PR replaces that with a block of code that adds the headers manually instead, e.g.:

HTTP/1.1 429 Too Many Requests
RateLimit-Limit: 1
RateLimit-Remaining: 0
RateLimit-Reset: 1702497360