Merge branch 'issue-77' into 'master'

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

Closes #77

See merge request honeyryderchuck/httpx!70
This commit is contained in:
HoneyryderChuck 2020-02-26 18:52:44 +00:00
commit b22c58505d

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