Get host from post to inbox

This commit is contained in:
bashrc committed 2019-08-15 23:33:42 +01:00
1 parent 0372da8ef1
commit 92469ed199
2 files changed
+8

No files matched your search

+6
View File
@@ -394,6 +394,12 @@ class PubServer(BaseHTTPRequestHandler):
#TODO convert headers to dict
headersDict={}
headersDict['host']=self.headers['host']
if messageJson.get('actor'):
actorDomain,actorPort=getDomainFromActor(messageJson['actor'])
if actorPort:
if actorPort!=80 and actorPort!=443:
actorDomain=actorDomain+':'+str(actorPort)
headersDict['host']=actorDomain
headersDict['signature']=self.headers['signature']
if self.headers.get('Date'):
headersDict['Date']=self.headers['Date']
+2
View File
@@ -7,6 +7,8 @@ __maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"
# see https://tools.ietf.org/html/draft-cavage-http-signatures-06
from Crypto.PublicKey import RSA
from Crypto.Hash import SHA256
#from Crypto.Signature import PKCS1_v1_5