mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-21 17:15:38 +03: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")
|
||||
|
||||
if not auth_headers:
|
||||
raise SynapseError(
|
||||
401, "Missing Authorization headers", Codes.UNAUTHORIZED,
|
||||
)
|
||||
|
||||
for auth in auth_headers:
|
||||
if auth.startswith("X-Matrix"):
|
||||
(origin, key, sig) = parse_auth_header(auth)
|
||||
|
|
Loading…
Reference in a new issue