Fix another port number bug

merge-requests/30/head
Bob Mottram 2020-12-16 11:38:40 +00:00
parent 7084a2059f
commit d853ba1978
2 changed files with 5 additions and 13 deletions

View File

@ -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())

View File

@ -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,