Respect the transport_schema when constructing host

This commit is contained in:
Honza Král
2016-06-28 16:44:58 +02:00
parent a359c5fba2
commit a53efe1705
+3 -1
View File
@@ -33,7 +33,9 @@ class Connection(object):
:arg url_prefix: optional url prefix for elasticsearch
:arg timeout: default timeout in seconds (float, default: 10)
"""
scheme = 'https' if use_ssl else 'http'
scheme = self.transport_schema
if use_ssl:
scheme += 's'
self.host = '%s://%s:%s' % (scheme, host, port)
if url_prefix:
url_prefix = '/' + url_prefix.strip('/')