actually pass signature and related headers to activity_request()

This commit is contained in:
jesopo 2019-09-15 14:27:34 +01:00
parent 06acbcfb98
commit ca68b27ccd
2 changed files with 6 additions and 4 deletions

View file

@ -50,6 +50,8 @@ class Inbox(object):
sign_headers.insert(0, ["(request-target)", "post %s" % parts.path]) sign_headers.insert(0, ["(request-target)", "post %s" % parts.path])
signature = ap_security.signature(private_key, sign_headers) signature = ap_security.signature(private_key, sign_headers)
return ap_utils.activity_request(self._url, activity.format(sender), headers.append(["signature", signature])
method="POST")
return ap_utils.activity_request(self._url, activity.format(sender),
method="POST", headers=headers)

View file

@ -14,9 +14,9 @@ def split_username(s):
return username, instance return username, instance
return None, None return None, None
def activity_request(url, data=None, method="GET", type=ACTIVITY_TYPE): def activity_request(url, data=None, method="GET", type=ACTIVITY_TYPE,
headers={}):
content_type = None content_type = None
headers = {}
if method == "POST": if method == "POST":
content_type = type content_type = type