Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warning #1323

Merged
merged 4 commits into from Sep 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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