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)
interceptor.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录