1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-09 17:15:35 +00:00

properly handle tunnel connect uri generation broken in #389

This commit is contained in:
James E. King III
2018-12-22 17:21:25 +00:00
parent 9039eab916
commit d4b706334c
2 changed files with 20 additions and 10 deletions

View File

@@ -58,7 +58,10 @@ class Request(object):
parse_uri = urlparse(self.uri)
port = parse_uri.port
if port is None:
port = {'https': 443, 'http': 80}[parse_uri.scheme]
try:
port = {'https': 443, 'http': 80}[parse_uri.scheme]
except KeyError:
pass
return port
@property