mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Check that we have auth headers and fail nicely
This commit is contained in:
parent
cd198dfea8
commit
ac9345b47a
@ -238,6 +238,11 @@ class TransportLayer(object):
|
|||||||
|
|
||||||
auth_headers = request.requestHeaders.getRawHeaders(b"Authorization")
|
auth_headers = request.requestHeaders.getRawHeaders(b"Authorization")
|
||||||
|
|
||||||
|
if not auth_headers:
|
||||||
|
raise SynapseError(
|
||||||
|
401, "Missing Authorization headers", Codes.UNAUTHORIZED,
|
||||||
|
)
|
||||||
|
|
||||||
for auth in auth_headers:
|
for auth in auth_headers:
|
||||||
if auth.startswith("X-Matrix"):
|
if auth.startswith("X-Matrix"):
|
||||||
(origin, key, sig) = parse_auth_header(auth)
|
(origin, key, sig) = parse_auth_header(auth)
|
||||||
|
Loading…
Reference in New Issue
Block a user