interceptor.py 文件源码

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

项目:deb-python-wsgi-intercept 作者: openstack 项目源码 文件源码
def _init_from_url(self, url):
        port = None
        parsed_url = urlparse.urlsplit(url)
        if ':' in parsed_url.netloc:
            host, port = parsed_url.netloc.split(':')
        else:
            host = parsed_url.netloc
        if not port:
            if parsed_url.scheme == 'https':
                port = 443
            else:
                port = 80
        path = parsed_url.path
        if path == '/' or not path:
            self.script_name = ''
        else:
            self.script_name = path
        self.host = host
        self.port = int(port)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号