summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2019-08-13 18:13:37 +0000
committerStan Hu <stanhu@gmail.com>2019-08-13 18:13:37 +0000
commitb6c51f57dd5637aaa4a45b7408a1f8b30ce3e7e3 (patch)
tree3e946b5af691ad3f3804d3e5a5fdf5f524da0cb0 /app/controllers
parentbd759eebcd3d824bc95b08d91dcaf705b05769bb (diff)
downloadgitlab-ce-b6c51f57dd5637aaa4a45b7408a1f8b30ce3e7e3.tar.gz
Return 429 on rate limiter on raw endpoint
It was originally returning 302 when the rate limit kicks in, because using the the correct status code makes it easier to track rate limiting events Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/65974
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/raw_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/projects/raw_controller.rb b/app/controllers/projects/raw_controller.rb
index 3254229d9cb..c94fdd9483d 100644
--- a/app/controllers/projects/raw_controller.rb
+++ b/app/controllers/projects/raw_controller.rb
@@ -26,7 +26,7 @@ class Projects::RawController < Projects::ApplicationController
limiter.log_request(request, :raw_blob_request_limit, current_user)
flash[:alert] = _('You cannot access the raw file. Please wait a minute.')
- redirect_to project_blob_path(@project, File.join(@ref, @path))
+ redirect_to project_blob_path(@project, File.join(@ref, @path)), status: :too_many_requests
end
def raw_blob_request_limit