From 8406b8042b2fadc6b13ad2c5350654564bcdfb59 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 12 Sep 2021 13:47:18 +0100 Subject: [PATCH] Get referer domain from signature --- daemon.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/daemon.py b/daemon.py index dfa0ebf3a..b3eb97ae1 100644 --- a/daemon.py +++ b/daemon.py @@ -11644,6 +11644,15 @@ class PubServer(BaseHTTPRequestHandler): refererDomain, refererPort = \ getDomainFromActor(self.headers['Referer']) refererDomain = getFullDomain(refererDomain, refererPort) + elif self.headers.get('Signature'): + if 'keyId="' in self.headers['Signature']: + refererDomain = self.headers['Signature'].split('keyId="')[1] + if '/' in refererDomain: + refererDomain = refererDomain.split('/')[0] + elif '#' in refererDomain: + refererDomain = refererDomain.split('#')[0] + elif '"' in refererDomain: + refererDomain = refererDomain.split('"')[0] elif uaStr: if '+https://' in uaStr: refererDomain = \