diff options
Diffstat (limited to 'lib/api/internal/base.rb')
-rw-r--r-- | lib/api/internal/base.rb | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/lib/api/internal/base.rb b/lib/api/internal/base.rb index 0d50a310b37..79c407b9581 100644 --- a/lib/api/internal/base.rb +++ b/lib/api/internal/base.rb @@ -30,10 +30,6 @@ module API project.http_url_to_repo end - def ee_post_receive_response_hook(response) - # Hook for EE to add messages - end - def check_allowed(params) # This is a separate method so that EE can alter its behaviour more # easily. @@ -73,13 +69,14 @@ module API } # Custom option for git-receive-pack command + if Feature.enabled?(:gitaly_upload_pack_filter, project, default_enabled: true) + payload[:git_config_options] << "uploadpack.allowFilter=true" << "uploadpack.allowAnySHA1InWant=true" + end + receive_max_input_size = Gitlab::CurrentSettings.receive_max_input_size.to_i + if receive_max_input_size > 0 payload[:git_config_options] << "receive.maxInputSize=#{receive_max_input_size.megabytes}" - - if Feature.enabled?(:gitaly_upload_pack_filter, project) - payload[:git_config_options] << "uploadpack.allowFilter=true" << "uploadpack.allowAnySHA1InWant=true" - end end response_with_status(**payload) @@ -116,10 +113,6 @@ module API # check_ip - optional, only in EE version, may limit access to # group resources based on its IP restrictions post "/allowed" do - if repo_type.snippet? && params[:protocol] != 'web' && Feature.disabled?(:version_snippets, actor.user) - break response_with_status(code: 401, success: false, message: 'Snippet git access is disabled.') - end - # It was moved to a separate method so that EE can alter its behaviour more # easily. check_allowed(params) @@ -216,8 +209,6 @@ module API response = PostReceiveService.new(actor.user, repository, project, params).execute - ee_post_receive_response_hook(response) - present response, with: Entities::InternalPostReceive::Response end end |