diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-05-17 12:31:44 +0200 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-05-18 14:14:31 +0200 |
commit | bc5aea42748633013a3e50d699a1b58281404d47 (patch) | |
tree | 322b4b5a8e30f16c5c7693639f299bbbb1ca782b /lib/gitlab_net.rb | |
parent | aa1a39a927b2810c07d23920d5035c6143d8c9cc (diff) | |
download | gitlab-shell-zj-repo-disk-path-removal.tar.gz |
Internal allowed response disk path is ignoredzj-repo-disk-path-removal
Diffstat (limited to 'lib/gitlab_net.rb')
-rw-r--r-- | lib/gitlab_net.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb index c93cf9a..1f4467c 100644 --- a/lib/gitlab_net.rb +++ b/lib/gitlab_net.rb @@ -15,14 +15,13 @@ class GitlabNet # rubocop:disable Metrics/ClassLength CHECK_TIMEOUT = 5 READ_TIMEOUT = 300 - def check_access(cmd, gl_repository, repo, actor, changes, protocol, env: {}) + def check_access(cmd, gl_repository, actor, changes, protocol, env: {}) changes = changes.join("\n") unless changes.is_a?(String) params = { action: cmd, changes: changes, gl_repository: gl_repository, - project: sanitize_path(repo), protocol: protocol, env: env } @@ -43,7 +42,6 @@ class GitlabNet # rubocop:disable Metrics/ClassLength 'API is not accessible', gl_repository: nil, gl_username: nil, - repository_path: nil, gitaly: nil) end end @@ -72,11 +70,10 @@ class GitlabNet # rubocop:disable Metrics/ClassLength JSON.parse(resp.body) rescue {} end - def merge_request_urls(gl_repository, repo_path, changes) + def merge_request_urls(gl_repository, changes) changes = changes.join("\n") unless changes.is_a?(String) changes = changes.encode('UTF-8', 'ASCII', invalid: :replace, replace: '') - url = "#{host}/merge_request_urls?project=#{URI.escape(repo_path)}&changes=#{URI.escape(changes)}" - url += "&gl_repository=#{URI.escape(gl_repository)}" if gl_repository + url = "#{host}/merge_request_urls?changes=#{URI.escape(changes)}&gl_repository=#{URI.escape(gl_repository)}" resp = get(url) if resp.code == '200' |