Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
197132cd
Commit
197132cd
authored
Jan 25, 2021
by
Quang-Minh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace default cache store by the instrumented cache store
parent
9182f7d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
lib/gitlab/rack_attack.rb
lib/gitlab/rack_attack.rb
+3
-1
No files found.
lib/gitlab/rack_attack.rb
View file @
197132cd
...
...
@@ -12,13 +12,15 @@ module Gitlab
rack_attack
::
Request
.
include
(
Gitlab
::
RackAttack
::
Request
)
# This is Rack::Attack::DEFAULT_THROTTLED_RESPONSE, modified to allow a custom response
Rack
::
A
ttack
.
throttled_response
=
lambda
do
|
env
|
rack_a
ttack
.
throttled_response
=
lambda
do
|
env
|
throttled_headers
=
Gitlab
::
RackAttack
.
throttled_response_headers
(
env
[
'rack.attack.matched'
],
env
[
'rack.attack.match_data'
]
)
[
429
,
{
'Content-Type'
=>
'text/plain'
}.
merge
(
throttled_headers
),
[
Gitlab
::
Throttle
.
rate_limiting_response_text
]]
end
rack_attack
.
cache
.
store
=
Gitlab
::
RackAttack
::
InstrumentedCacheStore
.
new
# Configure the throttles
configure_throttles
(
rack_attack
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment