Skip to content

Commit

Permalink
Merge pull request #116 from CGA1123/faraday-0.16.x
Browse files Browse the repository at this point in the history
Fallback to :response_body if :body is not set (faraday 1.0 support)
  • Loading branch information
georgeguimaraes committed Apr 6, 2020
2 parents 231ff1c + 88772d9 commit a053789
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -12,4 +12,5 @@ notifications:
email: false
gemfile:
- gemfiles/Gemfile.faraday-0.8
- gemfiles/Gemfile.faraday-1.0
- Gemfile
2 changes: 1 addition & 1 deletion faraday-http-cache.gemspec
Expand Up @@ -15,5 +15,5 @@ Gem::Specification.new do |gem|
gem.executables = []

gem.required_ruby_version = '>= 2.1.0'
gem.add_dependency 'faraday', '~> 0.8'
gem.add_dependency 'faraday', '>= 0.8'
end
12 changes: 12 additions & 0 deletions gemfiles/Gemfile.faraday-1.0
@@ -0,0 +1,12 @@
source 'http://rubygems.org'

gem 'faraday-http-cache', path: '..'

gem 'faraday', '1.0.0'
gem 'faraday_middleware', '1.0.0.rc1'

gem 'em-http-request', '~> 1.1'
gem 'rspec', '~> 3.1'
gem 'rake', '~> 12.0'
gem 'activesupport', '>= 5.0'
gem 'sinatra', '~> 2.0'
2 changes: 1 addition & 1 deletion lib/faraday/http_cache.rb
Expand Up @@ -297,7 +297,7 @@ def create_response(env)

{
status: hash[:status],
body: hash[:body],
body: hash[:body] || hash[:response_body],
response_headers: hash[:response_headers]
}
end
Expand Down

0 comments on commit a053789

Please sign in to comment.