mirror of
https://github.com/lostisland/faraday.git
synced 2025-10-04 00:02:03 -04:00
Merge branch 'master' into document-example
This commit is contained in:
commit
e500ccd42d
3
Gemfile
3
Gemfile
@ -24,9 +24,8 @@ group :test do
|
||||
gem 'rack-test', '>= 0.6', require: 'rack/test'
|
||||
gem 'rspec', '~> 3.7'
|
||||
gem 'rspec_junit_formatter', '~> 0.4'
|
||||
gem 'rubocop', '~> 0.65.0'
|
||||
gem 'rubocop', '~> 0.66.0'
|
||||
gem 'simplecov'
|
||||
gem 'sinatra', '~> 1.3'
|
||||
gem 'typhoeus', '~> 1.3', git: 'https://github.com/typhoeus/typhoeus.git',
|
||||
require: 'typhoeus'
|
||||
gem 'webmock', '~> 3.4'
|
||||
|
@ -538,7 +538,9 @@ module Faraday
|
||||
if params
|
||||
uri.query = params.to_query(params_encoder || options.params_encoder)
|
||||
end
|
||||
uri.query = nil if uri.query&.empty?
|
||||
# rubocop:disable Style/SafeNavigation
|
||||
uri.query = nil if uri.query && uri.query.empty?
|
||||
# rubocop:enable Style/SafeNavigation
|
||||
uri
|
||||
end
|
||||
|
||||
|
@ -3,8 +3,10 @@
|
||||
module Faraday
|
||||
class Response
|
||||
class RaiseError < Middleware
|
||||
# rubocop:disable Naming/ConstantName
|
||||
ClientErrorStatuses = (400...500).freeze
|
||||
ServerErrorStatuses = (500...600).freeze
|
||||
# rubocop:enable Naming/ConstantName
|
||||
|
||||
def on_complete(env)
|
||||
case env[:status]
|
||||
|
Loading…
x
Reference in New Issue
Block a user