fix: 命令存储 es 类型主机带用户名密码报错

pull/5590/head
xinwen 2021-02-18 15:07:49 +08:00 committed by 老广
parent 501ad698b7
commit e599bca951
1 changed files with 1 additions and 1 deletions

View File

@ -157,7 +157,7 @@ def command_storage_es_host_format_validator(host):
raise serializers.ValidationError(default_error_msg)
if ':' not in h.netloc:
raise serializers.ValidationError(default_error_msg)
_host, _port = h.netloc.split(':')
_host, _port = h.netloc.rsplit(':', maxsplit=1)
if not _host:
error_msg = _('Host invalid')
raise serializers.ValidationError(error_msg)