Skip to content

Commit

Permalink
Connection#build_exclusive_url: replace simple syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
hyuraku authored and olleolleolle committed Jan 13, 2023
1 parent a384efb commit f77d3a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/faraday/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -471,10 +471,10 @@ def build_request(method)
def build_exclusive_url(url = nil, params = nil, params_encoder = nil)
url = nil if url.respond_to?(:empty?) && url.empty?
base = url_prefix.dup
if url && base.path && base.path !~ %r{/$}
if url && !base.path.end_with?('/')
base.path = "#{base.path}/" # ensure trailing slash
end
url = url.to_s.gsub(':', '%3A') if url && URI.parse(url.to_s).opaque
url = url.to_s.gsub(':', '%3A') if Utils.URI(url.to_s).opaque
uri = url ? base + url : base
if params
uri.query = params.to_query(params_encoder || options.params_encoder)
Expand Down

0 comments on commit f77d3a1

Please sign in to comment.