fixing alt-svc match: if the alt-svc origin is h2, and the connection origin is https, and host/port match, then reuse the same connection

This commit is contained in:
HoneyryderChuck 2019-11-30 15:00:35 +00:00
parent e30469f8a3
commit a0db1b13d5

View File

@ -129,10 +129,11 @@ module HTTPX
# checks if this is connection is an alternative service of
# +uri+
def match_altsvcs?(uri)
AltSvc.cached_altsvc(@origin).any? do |altsvc|
origin = altsvc["origin"]
origin.altsvc_match?(uri.origin)
end
@origins.any? { |origin| uri.altsvc_match?(origin) } ||
AltSvc.cached_altsvc(@origin).any? do |altsvc|
origin = altsvc["origin"]
origin.altsvc_match?(uri.origin)
end
end
def connecting?