diff --git a/lib/httpx/connection.rb b/lib/httpx/connection.rb index 1a801cf1..6886bd95 100644 --- a/lib/httpx/connection.rb +++ b/lib/httpx/connection.rb @@ -101,7 +101,9 @@ module HTTPX # coalescable connections need to be mergeable! # but internally, #mergeable? is called before #coalescable? def coalescable?(connection) - if @io.protocol == "h2" && @origin.scheme == "https" + if @io.protocol == "h2" && + @origin.scheme == "https" && + connection.origin.scheme == "https" @io.verify_hostname(connection.origin.host) else @origin == connection.origin