i2p uses http prefix

merge-requests/30/head
Bob Mottram 2020-06-19 22:50:41 +00:00
parent 6610c1a165
commit 1d92aab187
2 changed files with 7 additions and 9 deletions

View File

@ -751,7 +751,7 @@ class PubServer(BaseHTTPRequestHandler):
elif (callingDomain.endswith('.i2p') and elif (callingDomain.endswith('.i2p') and
self.server.i2pDomain): self.server.i2pDomain):
wfResult = \ wfResult = \
webfingerMeta('i2p', self.server.i2pDomain) webfingerMeta('http', self.server.i2pDomain)
else: else:
wfResult = \ wfResult = \
webfingerMeta(self.server.httpPrefix, webfingerMeta(self.server.httpPrefix,
@ -772,7 +772,7 @@ class PubServer(BaseHTTPRequestHandler):
elif (callingDomain.endswith('.i2p') and elif (callingDomain.endswith('.i2p') and
self.server.i2pDomain): self.server.i2pDomain):
wfResult = \ wfResult = \
webfingerNodeInfo('i2p', self.server.i2pDomain) webfingerNodeInfo('http', self.server.i2pDomain)
else: else:
wfResult = \ wfResult = \
webfingerNodeInfo(self.server.httpPrefix, webfingerNodeInfo(self.server.httpPrefix,
@ -1576,7 +1576,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.onionDomain) self.server.onionDomain)
elif (callingDomain.endswith('.i2p') and elif (callingDomain.endswith('.i2p') and
self.server.i2pDomain): self.server.i2pDomain):
msg = htmlTermsOfService(self.server.baseDir, 'i2p', msg = htmlTermsOfService(self.server.baseDir, 'http',
self.server.i2pDomain) self.server.i2pDomain)
else: else:
msg = htmlTermsOfService(self.server.baseDir, msg = htmlTermsOfService(self.server.baseDir,
@ -1614,7 +1614,7 @@ class PubServer(BaseHTTPRequestHandler):
None) None)
elif callingDomain.endswith('.i2p'): elif callingDomain.endswith('.i2p'):
msg = \ msg = \
htmlAbout(self.server.baseDir, 'i2p', htmlAbout(self.server.baseDir, 'http',
self.server.i2pDomain, self.server.i2pDomain,
None) None)
else: else:

View File

@ -1651,10 +1651,8 @@ def sendSignedJson(postJsonObject: {}, session, baseDir: str,
return 8 return 8
withDigest = True withDigest = True
if toDomain.endswith('.onion'): if toDomain.endswith('.onion') or toDomain.endswith('.i2p'):
httpPrefix = 'http' httpPrefix = 'http'
elif toDomain.endswith('.i2p'):
httpPrefix = 'i2p'
# sharedInbox = False # sharedInbox = False
if toNickname == 'inbox': if toNickname == 'inbox':
@ -1965,7 +1963,7 @@ def sendToNamedAddresses(session, baseDir: str,
elif i2pDomain: elif i2pDomain:
if toDomain.endswith('.i2p'): if toDomain.endswith('.i2p'):
fromDomain = i2pDomain fromDomain = i2pDomain
fromHttpPrefix = 'i2p' fromHttpPrefix = 'http'
cc = [] cc = []
sendSignedJson(postJsonObject, session, baseDir, sendSignedJson(postJsonObject, session, baseDir,
nickname, fromDomain, port, nickname, fromDomain, port,
@ -2054,7 +2052,7 @@ def sendToFollowers(session, baseDir: str,
elif i2pDomain: elif i2pDomain:
if toDomain.endswith('.i2p'): if toDomain.endswith('.i2p'):
fromDomain = i2pDomain fromDomain = i2pDomain
fromHttpPrefix = 'i2p' fromHttpPrefix = 'http'
if withSharedInbox: if withSharedInbox:
toNickname = followerHandles[index].split('@')[0] toNickname = followerHandles[index].split('@')[0]