From d2d31d12a6e96551ccb315d5fc54f9451cfcfc89 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 23 Jun 2021 22:46:25 +0100 Subject: [PATCH] Domains could potentially be decentralised identifiers --- domainhandler.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/domainhandler.py b/domainhandler.py index f66a4032e..9725c37b0 100644 --- a/domainhandler.py +++ b/domainhandler.py @@ -13,6 +13,8 @@ def removeDomainPort(domain: str) -> str: eg. mydomain.com:80 becomes mydomain.com """ if ':' in domain: + if domain.startswith('did:'): + return domain domain = domain.split(':')[0] return domain @@ -21,6 +23,8 @@ def getPortFromDomain(domain: str) -> int: """If the domain has a port number appended then return it """ if ':' in domain: + if domain.startswith('did:'): + return None portStr = domain.split(':')[1] if portStr.isdigit(): return int(portStr)