Get host from post to inbox

master
Bob Mottram 2019-08-15 23:33:42 +01:00
parent 0372da8ef1
commit 92469ed199
2 changed files with 8 additions and 0 deletions

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']

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