summaryrefslogtreecommitdiff
path: root/src/leap/crypto/srpregister.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-03-13 11:45:34 -0300
committerTomás Touceda <chiiph@leap.se>2013-03-13 11:45:34 -0300
commitfc80cfd6d393534d71bfd0489557d3b4203cf4fd (patch)
treef47d5a1fa4598a994ba1f957458e14240faf386e /src/leap/crypto/srpregister.py
parenta1ca9e61b8702e07a9ec2d19954b2f2bd3ef7c27 (diff)
Default to port 443 if no port is specified
Diffstat (limited to 'src/leap/crypto/srpregister.py')
-rw-r--r--src/leap/crypto/srpregister.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/leap/crypto/srpregister.py b/src/leap/crypto/srpregister.py
index 471ef28f..c99f79ab 100644
--- a/src/leap/crypto/srpregister.py
+++ b/src/leap/crypto/srpregister.py
@@ -72,6 +72,8 @@ class SRPRegister(QtCore.QObject):
parsed_url = urlparse(provider_config.get_api_uri())
self._provider = parsed_url.hostname
self._port = parsed_url.port
+ if self._port is None:
+ self._port = "443"
self._register_path = register_path
@@ -85,17 +87,11 @@ class SRPRegister(QtCore.QObject):
@rtype: str
"""
- if self._port:
- uri = "https://%s:%s/%s/%s" % (
- self._provider,
- self._port,
- self._provider_config.get_api_version(),
- self._register_path)
- else:
- uri = "https://%s/%s/%s" % (
- self._provider,
- self._provider_config.get_api_version(),
- self._register_path)
+ uri = "https://%s:%s/%s/%s" % (
+ self._provider,
+ self._port,
+ self._provider_config.get_api_version(),
+ self._register_path)
return uri