Return Authorization header as a string

This commit is contained in:
2025-09-11 09:49:07 -04:00
parent 48790eaa6f
commit 04f7408434
2 changed files with 7 additions and 10 deletions

View File

@@ -106,8 +106,9 @@ def make_auth_header(destination, method, path, content=None) -> str:
destination,
key,
sig,
)
),
'utf-8'
)
)
return authorization_headers[0]
return authorization_headers[0].decode('utf-8')

View File

@@ -95,6 +95,10 @@ def federation_send(txnId):
# This only works for v2 rooms, but anything
# bigger than v2 isn't real, so not a problem
# We will need to implement a way to store every
# event we need if we want to send events in the
# future. We don't send events currently, however.
data = request.data.decode('utf-8')
parsed_data = json.loads(data)
response = {"pdus": {}}
@@ -167,14 +171,6 @@ def invite_user(data, endpVer):
])
else:
return jsonify({"event": globals.sign_json(invite_data["event"]), "room_version": "2"})
else:
print("membership is NOT an invitation, or it is missing.")
else:
print("event does not have content")
else:
print("data does have room version")
else:
print("data does have event")
return jsonify({
"errcode": "M_FORBIDDEN",