mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-09-20 23:54:36 -04:00
Respond with more helpful error messages for unsigned requests
This commit is contained in:
parent
25d80f35f1
commit
07639c79d9
6 changed files with 45 additions and 10 deletions
|
@ -233,7 +233,7 @@ class TransportLayer(object):
|
|||
return (origin, key, sig)
|
||||
except:
|
||||
raise SynapseError(
|
||||
400, "Malformed Authorization Header", Codes.FORBIDDEN
|
||||
400, "Malformed Authorization header", Codes.UNAUTHORIZED
|
||||
)
|
||||
|
||||
auth_headers = request.requestHeaders.getRawHeaders(b"Authorization")
|
||||
|
@ -246,7 +246,7 @@ class TransportLayer(object):
|
|||
|
||||
if not json_request["signatures"]:
|
||||
raise SynapseError(
|
||||
401, "Missing Authorization headers", Codes.FORBIDDEN,
|
||||
401, "Missing Authorization headers", Codes.UNAUTHORIZED,
|
||||
)
|
||||
|
||||
yield self.keyring.verify_json_for_server(origin, json_request)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue