summaryrefslogtreecommitdiff
path: root/lib/gitlab
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-10 00:08:12 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-10 00:08:12 +0000
commit9ac561230fb7a94c8f8e35163fe47fdb9829b108 (patch)
treeb44d58434301914890663eee246103596f106552 /lib/gitlab
parent5aa96ff14229dba7e35f213354963febf3ad2833 (diff)
downloadgitlab-ce-9ac561230fb7a94c8f8e35163fe47fdb9829b108.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab')
-rw-r--r--lib/gitlab/middleware/read_only/controller.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/gitlab/middleware/read_only/controller.rb b/lib/gitlab/middleware/read_only/controller.rb
index ca8f4e34802..cdab86540f8 100644
--- a/lib/gitlab/middleware/read_only/controller.rb
+++ b/lib/gitlab/middleware/read_only/controller.rb
@@ -90,12 +90,14 @@ module Gitlab
# Overridden in EE module
def whitelisted_routes
- grack_route? || internal_route? || lfs_route? || compare_git_revisions_route? || sidekiq_route? || session_route? || graphql_query?
+ workhorse_passthrough_route? || internal_route? || lfs_route? || compare_git_revisions_route? || sidekiq_route? || session_route? || graphql_query?
end
- def grack_route?
+ # URL for requests passed through gitlab-workhorse to rails-web
+ # https://gitlab.com/gitlab-org/gitlab-workhorse/-/merge_requests/12
+ def workhorse_passthrough_route?
# Calling route_hash may be expensive. Only do it if we think there's a possible match
- return false unless
+ return false unless request.post? &&
request.path.end_with?('.git/git-upload-pack', '.git/git-receive-pack')
WHITELISTED_GIT_ROUTES[route_hash[:controller]]&.include?(route_hash[:action])