forked from cloudfoundry/cloud_controller_ng
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
V2 Rate Limiter: improve code formatting
- Replace 'skip_rate_limiting' with 'apply_rate_limiting' - Code cleanup - Improve signatures & code structure - Use shared test examples - Fix admin test
- Loading branch information
Showing
7 changed files
with
161 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
RSpec.shared_examples_for 'endpoint exempts from rate limiting' do |header_suffix=''| | ||
it 'exempts them from rate limiting' do | ||
allow(ActionDispatch::Request).to receive(:new).and_return(fake_request) | ||
_, response_headers, _ = middleware.call(env) | ||
expect(request_counter).not_to have_received(:get) | ||
expect(request_counter).not_to have_received(:increment) | ||
expect(response_headers["X-RateLimit-Limit#{header_suffix}"]).to be_nil | ||
expect(response_headers["X-RateLimit-Remaining#{header_suffix}"]).to be_nil | ||
expect(response_headers["X-RateLimit-Reset#{header_suffix}"]).to be_nil | ||
end | ||
end |
Oops, something went wrong.