fix: 修改获取 rdp-file / client-url / smart-endpoint 时endpoint host后台处理为当前请求的host

This commit is contained in:
Jiangjie.Bai
2022-07-19 18:59:25 +08:00
committed by 老广
parent bdf59da0f6
commit 29656b1630
2 changed files with 5 additions and 13 deletions

View File

@@ -63,8 +63,6 @@ class Endpoint(JMSModel):
'http_port': 0,
}
endpoint, created = cls.objects.get_or_create(id=cls.default_id, defaults=data)
if not endpoint.host and request:
endpoint.host = request.get_host().split(':')[0]
return endpoint
@classmethod
@@ -122,4 +120,7 @@ class EndpointRule(JMSModel):
endpoint = endpoint_rule.endpoint
else:
endpoint = Endpoint.get_or_create_default(request)
if not endpoint.host and request:
# 动态添加 current request host
endpoint.host = request.get_host().split(':')[0]
return endpoint