def __host_from_target(target):
"""Calculate the value of the host header from a target.
Args:
target: A string representing the target hostname or the constant
DEFAULT_APP_VERSION.
Returns:
The string to be used as the host header, or None if it can not be
determined.
"""
default_hostname = app_identity.get_default_version_hostname()
if default_hostname is None:
return None
if target is DEFAULT_APP_VERSION:
return default_hostname
else:
return '%s.%s' % (target, default_hostname)
评论列表
文章目录