Merge branch '5974-geo-unauthenticated-rate-limits-should-not-block-geo-requests' into 'master'
Backport of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/5876/ Closes #5974 See merge request gitlab-org/gitlab-ce!19189
This commit is contained in:
commit
ab680dfc64
1 changed files with 5 additions and 1 deletions
|
@ -26,7 +26,7 @@ class Rack::Attack
|
|||
throttle('throttle_unauthenticated', Gitlab::Throttle.unauthenticated_options) do |req|
|
||||
Gitlab::Throttle.settings.throttle_unauthenticated_enabled &&
|
||||
req.unauthenticated? &&
|
||||
!req.api_internal_request? &&
|
||||
!req.should_be_skipped? &&
|
||||
req.ip
|
||||
end
|
||||
|
||||
|
@ -59,6 +59,10 @@ class Rack::Attack
|
|||
path =~ %r{^/api/v\d+/internal/}
|
||||
end
|
||||
|
||||
def should_be_skipped?
|
||||
api_internal_request?
|
||||
end
|
||||
|
||||
def web_request?
|
||||
!api_request?
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue