summaryrefslogtreecommitdiff
path: root/lib/gitlab_net.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab_net.rb')
-rw-r--r--lib/gitlab_net.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb
index 080898e..57ae452 100644
--- a/lib/gitlab_net.rb
+++ b/lib/gitlab_net.rb
@@ -33,9 +33,9 @@ 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, resp.code, 'API is not accessible')
end