diff --git a/httpsig.py b/httpsig.py index 97a001d6..7d9865c9 100644 --- a/httpsig.py +++ b/httpsig.py @@ -22,6 +22,7 @@ except ImportError: import base64 from time import gmtime, strftime import datetime +from utils import getFullDomain def messageContentDigest(messageBodyJsonStr: str) -> str: @@ -40,15 +41,9 @@ def signPostHeaders(dateStr: str, privateKeyPem: str, """Returns a raw signature string that can be plugged into a header and used to verify the authenticity of an HTTP transmission. """ - if port: - if port != 80 and port != 443: - if ':' not in domain: - domain = domain + ':' + str(port) + domain = getFullDomain(domain, port) - if toPort: - if toPort != 80 and toPort != 443: - if ':' not in toDomain: - toDomain = toDomain + ':' + str(port) + toDomain = getFullDomain(toDomain, toPort) if not dateStr: dateStr = strftime("%a, %d %b %Y %H:%M:%S %Z", gmtime()) diff --git a/socnet.py b/socnet.py index 6873d388..31c59eb8 100644 --- a/socnet.py +++ b/socnet.py @@ -10,6 +10,7 @@ from session import createSession from webfinger import webfingerHandle from posts import getPersonBox from posts import getPostDomains +from utils import getFullDomain def instancesGraph(baseDir: str, handles: str, @@ -46,11 +47,7 @@ def instancesGraph(baseDir: str, handles: str, nickname = handle.split('@')[0] domain = handle.split('@')[1] - domainFull = domain - if port: - if port != 80 and port != 443: - if ':' not in domain: - domainFull = domain + ':' + str(port) + domainFull = getFullDomain(domain, port) handle = httpPrefix + "://" + domainFull + "/@" + nickname wfRequest = \ webfingerHandle(session, handle, httpPrefix,