Skip to content

Commit

Permalink
Support Net::HTTP::Persistent v4
Browse files Browse the repository at this point in the history
Applied comment
  • Loading branch information
Meat-Chopper committed Nov 16, 2020
1 parent 91d2d19 commit 8482304
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/httpi/adapter/net_http_persistent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class NetHTTPPersistent < NetHTTP
private

def create_client
if is_v3
if Gem::Version.new(Net::HTTP::Persistent::VERSION) >= Gem::Version.new('3.0.0')
Net::HTTP::Persistent.new name: thread_key
else
Net::HTTP::Persistent.new thread_key
Expand Down Expand Up @@ -42,11 +42,6 @@ def setup_client
def thread_key
@request.url.host.split(/\W/).reject{|p|p == ""}.join('-')
end

def is_v3
Net::HTTP::Persistent::VERSION.start_with? "3."
end

end
end
end

0 comments on commit 8482304

Please sign in to comment.