diff options
Diffstat (limited to 'lib/gitlab/external_authorization/response.rb')
-rw-r--r-- | lib/gitlab/external_authorization/response.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/gitlab/external_authorization/response.rb b/lib/gitlab/external_authorization/response.rb index 04f9688fad0..8656065303d 100644 --- a/lib/gitlab/external_authorization/response.rb +++ b/lib/gitlab/external_authorization/response.rb @@ -5,16 +5,16 @@ module Gitlab class Response include ::Gitlab::Utils::StrongMemoize - def initialize(excon_response) - @excon_response = excon_response + def initialize(response) + @response = response end def valid? - @excon_response && [200, 401, 403].include?(@excon_response.status) + @response && [200, 401, 403].include?(@response.code) end def successful? - valid? && @excon_response.status == 200 + valid? && @response.code == 200 end def reason @@ -28,7 +28,7 @@ module Gitlab end def parse_response! - Gitlab::Json.parse(@excon_response.body) + Gitlab::Json.parse(@response.body) rescue JSON::JSONError # The JSON response is optional, so don't fail when it's missing nil |