Merge pull request #847 from jetsecurity/fix_distinct_ports
Allow distinct values between the Host and Port optionsreadme-wiki
commit
7e0809f562
|
@ -102,14 +102,16 @@ class Listeners:
|
|||
if len(parts) != 1 and parts[-1].isdigit():
|
||||
# if a port is specified with http://host:port
|
||||
listenerObject.options['Host']['Value'] = "%s://%s" % (protocol, value)
|
||||
listenerObject.options['Port']['Value'] = parts[-1]
|
||||
if listenerObject.options['Port']['Value'] == '':
|
||||
listenerObject.options['Port']['Value'] = parts[-1]
|
||||
elif listenerObject.options['Port']['Value'] != '':
|
||||
# otherwise, check if the port value was manually set
|
||||
listenerObject.options['Host']['Value'] = "%s://%s:%s" % (protocol, value, listenerObject.options['Port']['Value'])
|
||||
else:
|
||||
# otherwise use default port
|
||||
listenerObject.options['Host']['Value'] = "%s://%s" % (protocol, value)
|
||||
listenerObject.options['Port']['Value'] = defaultPort
|
||||
if listenerObject.options['Port']['Value'] == '':
|
||||
listenerObject.options['Port']['Value'] = defaultPort
|
||||
|
||||
return True
|
||||
|
||||
|
@ -123,11 +125,6 @@ class Listeners:
|
|||
|
||||
if option == 'Port':
|
||||
listenerObject.options[option]['Value'] = value
|
||||
# set the port in the Host configuration as well
|
||||
host = listenerObject.options['Host']['Value']
|
||||
parts = host.split(':')
|
||||
if len(parts) == 2 or len(parts) == 3:
|
||||
listenerObject.options['Host']['Value'] = "%s:%s:%s" % (parts[0], parts[1], str(value))
|
||||
return True
|
||||
|
||||
elif option == 'StagingKey':
|
||||
|
|
Loading…
Reference in New Issue