client.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:TCP-IP 作者: JackZ0 项目源码 文件源码
def determine_user_agent(config):
    """
    Set a user_agent string in the config based on the choice of plugins.
    (this wasn't knowable at construction time)

    :returns: the client's User-Agent string
    :rtype: `str`
    """

    # WARNING: To ensure changes are in line with Certbot's privacy
    # policy, talk to a core Certbot team member before making any
    # changes here.
    if config.user_agent is None:
        ua = ("CertbotACMEClient/{0} ({1}; {2}{8}) Authenticator/{3} Installer/{4} "
              "({5}; flags: {6}) Py/{7}")
        ua = ua.format(certbot.__version__, cli.cli_command, util.get_os_info_ua(),
                       config.authenticator, config.installer, config.verb,
                       ua_flags(config), platform.python_version(),
                       "; " + config.user_agent_comment if config.user_agent_comment else "")
    else:
        ua = config.user_agent
    return ua
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号