utils.py 文件源码

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

项目:python-zeep 作者: mvantellingen 项目源码 文件源码
def url_http_to_https(value):
    parts = urlparse(value)
    if parts.scheme != 'http':
        return value

    # Check if the url contains ':80' and remove it if that is the case
    netloc_parts = parts.netloc.rsplit(':', 1)
    if len(netloc_parts) == 2 and netloc_parts[1] == '80':
        netloc = netloc_parts[0]
    else:
        netloc = parts.netloc
    return urlunparse(('https', netloc) + parts[2:])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号