Return Authorization header as a string
This commit is contained in:
@@ -106,8 +106,9 @@ def make_auth_header(destination, method, path, content=None) -> str:
|
|||||||
destination,
|
destination,
|
||||||
key,
|
key,
|
||||||
sig,
|
sig,
|
||||||
)
|
),
|
||||||
|
'utf-8'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
return authorization_headers[0]
|
return authorization_headers[0].decode('utf-8')
|
||||||
|
|||||||
12
src/s2s.py
12
src/s2s.py
@@ -95,6 +95,10 @@ def federation_send(txnId):
|
|||||||
# This only works for v2 rooms, but anything
|
# This only works for v2 rooms, but anything
|
||||||
# bigger than v2 isn't real, so not a problem
|
# 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')
|
data = request.data.decode('utf-8')
|
||||||
parsed_data = json.loads(data)
|
parsed_data = json.loads(data)
|
||||||
response = {"pdus": {}}
|
response = {"pdus": {}}
|
||||||
@@ -167,14 +171,6 @@ def invite_user(data, endpVer):
|
|||||||
])
|
])
|
||||||
else:
|
else:
|
||||||
return jsonify({"event": globals.sign_json(invite_data["event"]), "room_version": "2"})
|
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({
|
return jsonify({
|
||||||
"errcode": "M_FORBIDDEN",
|
"errcode": "M_FORBIDDEN",
|
||||||
|
|||||||
Reference in New Issue
Block a user