('http://go.com/', 80),
('http://go.com:80/', 80),
('http://go.com:3000/', 3000),
- ('https://go.com/', 433),
- ('https://go.com:433/', 433),
+ ('https://go.com/', 443),
+ ('https://go.com:443/', 443),
('https://go.com:3000/', 3000),
])
def test_port(uri, expected_port):
def build_uri(**parts):
port = parts['port']
scheme = parts['protocol']
- default_port = {'https': 433, 'http': 80}[scheme]
+ default_port = {'https': 443, 'http': 80}[scheme]
parts['port'] = ':{0}'.format(port) if port != default_port else ''
return "{protocol}://{host}{port}{path}".format(**parts)
parse_uri = urlparse(self.uri)
port = parse_uri.port
if port is None:
- port = {'https': 433, 'http': 80}[parse_uri.scheme]
+ port = {'https': 443, 'http': 80}[parse_uri.scheme]
return port
@property
Returns empty string for the default port and ':port' otherwise
"""
port = self.real_connection.port
- default_port = {'https': 433, 'http': 80}[self._protocol]
+ default_port = {'https': 443, 'http': 80}[self._protocol]
return ':{0}'.format(port) if port != default_port else ''
def _uri(self, url):