From 92469ed19983d1c336e422c076bbf5adcd780fd1 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 15 Aug 2019 23:33:42 +0100 Subject: [PATCH] Get host from post to inbox --- daemon.py | 6 ++++++ httpsig.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/daemon.py b/daemon.py index 10854bfd4..e7dbdf987 100644 --- a/daemon.py +++ b/daemon.py @@ -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'] diff --git a/httpsig.py b/httpsig.py index 5e001781c..3ae13d0e2 100644 --- a/httpsig.py +++ b/httpsig.py @@ -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