-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Rack::Attack #526
base: main
Are you sure you want to change the base?
Add Rack::Attack #526
Conversation
end | ||
|
||
describe "throttle_authenticated_asking" do | ||
let (:user) { FactoryBot.create(:user) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Correctable] Lint/ParenthesesAsGroupedExpression: (...) interpreted as grouped expression.
|
||
before(:each) do | ||
Rack::Attack.enabled = true | ||
Rack::Attack.reset! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Correctable] Layout/TrailingWhitespace: Trailing whitespace detected.
Codecov Report
@@ Coverage Diff @@
## main #526 +/- ##
=======================================
Coverage 85.43% 85.43%
=======================================
Files 129 129
Lines 2396 2396
=======================================
Hits 2047 2047
Misses 349 349 Continue to review full report at Codecov.
|
This PR adds, configures and tests
Rack::Attack
for rate-limiting. Currently only on the/ajax/ask
endpoint.Due to
AjaxController
sending off it's own responses, this doesn't fully work yet however, because we always return 200 for a successful request, regardless of the middleware saying stuff is throttled or not. This needs a workaround, or needs to wait until #444 is implemented.Fixes #518