From 04f74084348cffc674db2e1048bf53de42a61936 Mon Sep 17 00:00:00 2001 From: Kierre Date: Thu, 11 Sep 2025 09:49:07 -0400 Subject: [PATCH] Return Authorization header as a string --- src/globals.py | 5 +++-- src/s2s.py | 12 ++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/globals.py b/src/globals.py index 22f89cd..8b812e8 100644 --- a/src/globals.py +++ b/src/globals.py @@ -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') diff --git a/src/s2s.py b/src/s2s.py index 879b0d1..38698dd 100644 --- a/src/s2s.py +++ b/src/s2s.py @@ -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",