From 6fd4f6804125c0992296d064f3c074d39efeb091 Mon Sep 17 00:00:00 2001 From: Ash McKenzie Date: Mon, 20 Aug 2018 14:45:31 +1000 Subject: Custom Action support --- lib/gitlab_net.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/gitlab_net.rb') 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 -- cgit v1.2.1