when using connection coalescing, make sure that, if we're using host

certificate verification, that the coalescable connection also wants to
use https
This commit is contained in:
HoneyryderChuck 2020-02-26 18:37:29 +00:00
parent de6adec305
commit 1765f6c645

View File

@ -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