]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
Fix default port for HTTPS.
authorAbhinav Gupta <mail@abhinavg.net>
Tue, 24 Feb 2015 07:37:04 +0000 (23:37 -0800)
committerAbhinav Gupta <mail@abhinavg.net>
Tue, 24 Feb 2015 07:37:04 +0000 (23:37 -0800)
tests/unit/test_request.py
vcr/migration.py
vcr/request.py
vcr/stubs/__init__.py

index 28b695debcc59f2bbac8eeac7e41cc5610b20d7a..9a26acc6c0dbc407d706d10afe3bd9b87bdc2f75 100644 (file)
@@ -21,8 +21,8 @@ def test_headers():
     ('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):
index fb3f317560f2fef97fed7907d9aaa03605afd067..9e423f8d1f765f086506881d26e7b42da8c7d59e 100644 (file)
@@ -58,7 +58,7 @@ PARTS = [
 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)
 
index 30c052dce0a04bb1dfd9598578648ab730648175..052573292f70af068a5575102e980cbb2d747f3e 100644 (file)
@@ -51,7 +51,7 @@ class Request(object):
         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
index bad8a8345c68e0464238161de829d771ae9cd02b..c4f10d681e16a66c64dc01e5975c8125e228d9d1 100644 (file)
@@ -128,7 +128,7 @@ class VCRConnection(object):
         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):