trying to fix outbound AP headers and signature, testing w/social.sitedethib.com

thib
Ryan Barrett 2020-10-31 15:24:56 -07:00
rodzic 8af4571648
commit 199d4d6f63
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
1 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -60,6 +60,7 @@ def send(activity, inbox_url, user_domain):
headers=('Date', 'Digest', 'Host'))
# deliver to inbox
body = json_dumps(activity).encode()
headers = {
'Content-Type': common.CONTENT_TYPE_AS2,
# required for HTTP Signature
@ -67,10 +68,11 @@ def send(activity, inbox_url, user_domain):
'Date': datetime.datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S GMT'),
# required by Mastodon
# https://github.com/tootsuite/mastodon/pull/14556#issuecomment-674077648
'Digest': 'SHA256=' + b64encode(sha256(json_dumps(activity).encode()).digest()).decode(),
'Digest': 'SHA256=' + b64encode(sha256(body).digest()).decode(),
'Host': util.domain_from_link(inbox_url),
}
return common.requests_post(inbox_url, json=activity, auth=auth, headers=headers)
return common.requests_post(inbox_url, data=body, auth=auth,
headers=headers)
class ActorHandler(common.Handler):