diff options
author | Stan Hu <stanhu@gmail.com> | 2018-09-07 22:30:53 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-09-07 22:30:53 +0000 |
commit | 2cf0298fa5d7c4da8bed44200359dd69a6a08eca (patch) | |
tree | c2cf728f776f60f8bae83a418d5a2c2faac66324 /lib/gitlab_net.rb | |
parent | 4f0a474cb88f7edae994e82d2ca977b1e6ed2e47 (diff) | |
parent | 524d523ed654469858a7a482d56f4d4661c61036 (diff) | |
download | gitlab-shell-2cf0298fa5d7c4da8bed44200359dd69a6a08eca.tar.gz |
Merge branch 'ash.mckenzie/custom-action-support' into 'master'v8.3.0
Custom Action support
See merge request gitlab-org/gitlab-shell!215
Diffstat (limited to 'lib/gitlab_net.rb')
-rw-r--r-- | lib/gitlab_net.rb | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb index 5af2da6..57ae452 100644 --- a/lib/gitlab_net.rb +++ b/lib/gitlab_net.rb @@ -3,10 +3,8 @@ require 'openssl' require 'json' require_relative 'gitlab_config' -require_relative 'gitlab_logger' require_relative 'gitlab_access' require_relative 'gitlab_lfs_authentication' -require_relative 'httpunix' require_relative 'http_helper' class GitlabNet # rubocop:disable Metrics/ClassLength @@ -35,18 +33,11 @@ class GitlabNet # rubocop:disable Metrics/ClassLength url = "#{internal_api_endpoint}/allowed" resp = post(url, params) - case resp.code.to_s - when HTTP_SUCCESS, HTTP_UNAUTHORIZED, HTTP_NOT_FOUND - GitAccessStatus.create_from_json(resp.body) + case resp.code + when HTTP_SUCCESS, HTTP_MULTIPLE_CHOICES, HTTP_UNAUTHORIZED, HTTP_NOT_FOUND + GitAccessStatus.create_from_json(resp.body, resp.code) else - GitAccessStatus.new(false, - 'API is not accessible', - gl_repository: nil, - gl_id: nil, - gl_username: nil, - git_config_options: nil, - gitaly: nil, - git_protocol: nil) + GitAccessStatus.new(false, resp.code, 'API is not accessible') end end |