diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-04-12 22:44:55 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-04-24 16:17:52 -0300 |
commit | 104144f373a58069680dd3639e89eb1fce9a3a9b (patch) | |
tree | db4d837d1f7cd9fd3b7fa369a0d68367faecbb0b /lib/github/client.rb | |
parent | 8538066e00d8bda542f219fb03d104f8364760bd (diff) | |
download | gitlab-ce-104144f373a58069680dd3639e89eb1fce9a3a9b.tar.gz |
Refactoring client to not parse response body automatically
Diffstat (limited to 'lib/github/client.rb')
-rw-r--r-- | lib/github/client.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/github/client.rb b/lib/github/client.rb index 2511523bf6a..07cf264e8d7 100644 --- a/lib/github/client.rb +++ b/lib/github/client.rb @@ -4,10 +4,8 @@ module Github def initialize(token) @connection = Faraday.new(url: 'https://api.github.com') do |faraday| - faraday.adapter :net_http_persistent - faraday.response :json, content_type: /\bjson$/ faraday.authorization 'token', token - faraday.response :logger + faraday.adapter :net_http end end @@ -15,7 +13,8 @@ module Github rate_limit = RateLimit.new(connection) sleep rate_limit.reset_in if rate_limit.exceed? - Github::Response.new(connection.get(url, query)) + response = connection.get(url, query) + Github::Response.new(response.headers, response.body, response.status) end end end |