mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-07-12 17:59:39 -04:00
Check that we have auth headers and fail nicely
This commit is contained in:
parent
cd198dfea8
commit
ac9345b47a
1 changed files with 5 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue