handle Splunk hostname case from support

This commit is contained in:
AlanCoding
2017-07-07 16:48:00 -04:00
parent a515a174e6
commit d23e11c43c
2 changed files with 8 additions and 3 deletions

View File

@@ -159,7 +159,8 @@ class BaseHandler(logging.Handler):
"""
host = self.host or ''
# urlparse requires '//' to be provided if scheme is not specified
if not urlparse.urlsplit(host).scheme and not host.startswith('//'):
original_parsed = urlparse.urlsplit(host)
if (not original_parsed.scheme and not host.startswith('//')) or original_parsed.hostname is None:
host = '%s://%s' % (scheme, host) if scheme else '//%s' % host
parsed = urlparse.urlsplit(host)