Add urlparse fix for Python 3.6.x . Deprecate support for Python 3.5.x (#278)
* Add fix required to run on Python 3.6. Python 3.5.x is no longer supported as it reports syntax error and no longer recognize typing syntax * Prepare for v2.1.2
This commit is contained in:
parent
87a54a0781
commit
434e2502ec
|
@ -8,5 +8,5 @@
|
||||||
:copyright: (c) 2013-present by Abhinav Singh and contributors.
|
:copyright: (c) 2013-present by Abhinav Singh and contributors.
|
||||||
:license: BSD, see LICENSE for more details.
|
:license: BSD, see LICENSE for more details.
|
||||||
"""
|
"""
|
||||||
VERSION = (2, 1, 1)
|
VERSION = (2, 1, 2)
|
||||||
__version__ = '.'.join(map(str, VERSION[0:3]))
|
__version__ = '.'.join(map(str, VERSION[0:3]))
|
||||||
|
|
|
@ -111,9 +111,13 @@ class HttpParser:
|
||||||
def set_line_attributes(self) -> None:
|
def set_line_attributes(self) -> None:
|
||||||
if self.type == httpParserTypes.REQUEST_PARSER:
|
if self.type == httpParserTypes.REQUEST_PARSER:
|
||||||
if self.method == httpMethods.CONNECT and self.url:
|
if self.method == httpMethods.CONNECT and self.url:
|
||||||
self.host = self.url.scheme
|
if self.url.scheme == b'':
|
||||||
self.port = 443 if self.url.path == b'' else \
|
u = urlparse.urlsplit(b'//' + self.url.path)
|
||||||
int(self.url.path)
|
self.host, self.port = u.hostname, u.port
|
||||||
|
else:
|
||||||
|
self.host = self.url.scheme
|
||||||
|
self.port = 443 if self.url.path == b'' else \
|
||||||
|
int(self.url.path)
|
||||||
elif self.url:
|
elif self.url:
|
||||||
self.host, self.port = self.url.hostname, self.url.port \
|
self.host, self.port = self.url.hostname, self.url.port \
|
||||||
if self.url.port else DEFAULT_HTTP_PORT
|
if self.url.port else DEFAULT_HTTP_PORT
|
||||||
|
|
4
setup.py
4
setup.py
|
@ -10,7 +10,7 @@
|
||||||
"""
|
"""
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
VERSION = (2, 1, 1)
|
VERSION = (2, 1, 2)
|
||||||
__version__ = '.'.join(map(str, VERSION[0:3]))
|
__version__ = '.'.join(map(str, VERSION[0:3]))
|
||||||
__description__ = '''⚡⚡⚡Fast, Lightweight, Pluggable, TLS interception capable proxy server
|
__description__ = '''⚡⚡⚡Fast, Lightweight, Pluggable, TLS interception capable proxy server
|
||||||
focused on Network monitoring, controls & Application development, testing, debugging.'''
|
focused on Network monitoring, controls & Application development, testing, debugging.'''
|
||||||
|
@ -32,7 +32,7 @@ if __name__ == '__main__':
|
||||||
long_description_content_type='text/markdown',
|
long_description_content_type='text/markdown',
|
||||||
download_url=__download_url__,
|
download_url=__download_url__,
|
||||||
license=__license__,
|
license=__license__,
|
||||||
python_requires='!=2.*, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*',
|
python_requires='!=2.*, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*',
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
packages=find_packages(exclude=['tests', 'tests.*']),
|
packages=find_packages(exclude=['tests', 'tests.*']),
|
||||||
package_data={'proxy': ['py.typed']},
|
package_data={'proxy': ['py.typed']},
|
||||||
|
|
Loading…
Reference in New Issue