Skip to content

Commit

Permalink
Fix deprecation warning (#1323)
Browse files Browse the repository at this point in the history
  • Loading branch information
iMacTia committed Sep 13, 2021
1 parent a84e6b4 commit 18ba248
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .rubocop_todo.yml
Expand Up @@ -14,7 +14,7 @@ Metrics/AbcSize:
# Offense count: 5
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 256
Max: 260

# Offense count: 15
# Configuration parameters: IgnoredMethods.
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -7,6 +7,7 @@ ruby RUBY_VERSION
gem 'jruby-openssl', '~> 0.10.7', platforms: :jruby

group :development, :test do
gem 'irb'
gem 'pry'
gem 'rake'
end
Expand Down
7 changes: 6 additions & 1 deletion lib/faraday/connection.rb
Expand Up @@ -433,13 +433,18 @@ def url_prefix=(url, encoder = nil)
uri.query = nil

with_uri_credentials(uri) do |user, password|
basic_auth user, password
set_basic_auth(user, password)
uri.user = uri.password = nil
end

@proxy = proxy_from_env(url) unless @manual_proxy
end

def set_basic_auth(user, password)
header = Faraday::Request::BasicAuthentication.header(user, password)
headers[Faraday::Request::Authorization::KEY] = header
end

# Sets the path prefix and ensures that it always has a leading
# slash.
#
Expand Down

0 comments on commit 18ba248

Please sign in to comment.