mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-04 00:00:37 -04:00
Merge branch 'issue-184' into 'master'
bugfix: bust cache lookup if returned set from different ip family Closes #184 See merge request honeyryderchuck/httpx!195
This commit is contained in:
commit
eeeac1f785
@ -74,6 +74,8 @@ module HTTPX
|
||||
|
||||
addresses.select! { |addr| addr.family == @family }
|
||||
|
||||
return if addresses.empty?
|
||||
|
||||
emit_addresses(connection, @family, addresses)
|
||||
end
|
||||
|
||||
|
24
regression_tests/bug_0_19_3_test.rb
Normal file
24
regression_tests/bug_0_19_3_test.rb
Normal file
@ -0,0 +1,24 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "test_helper"
|
||||
require "support/http_helpers"
|
||||
require "support/minitest_extensions"
|
||||
|
||||
class Bug_0_19_3_Test < Minitest::Test
|
||||
include HTTPHelpers
|
||||
|
||||
def test_dns_lookup_cache_for_domains_with_same_cname
|
||||
HTTPX.plugin(SessionWithPool).wrap do |http|
|
||||
_response1 = http.get("https://accounts.vivapayments.com")
|
||||
_response2 = http.get("https://api.vivapayments.com")
|
||||
|
||||
assert http.pool.connection_count == 2
|
||||
|
||||
conn1, conn2 = http.pool.connections
|
||||
|
||||
assert conn1.origin != conn2.origin
|
||||
|
||||
assert conn1.addresses.sort == conn2.addresses.sort
|
||||
end
|
||||
end
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user