summary refs log tree commit diff
path: root/synapse/federation
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-10-13 16:39:15 +0100
committerMark Haines <mark.haines@matrix.org>2014-10-13 16:39:15 +0100
commit07639c79d9536cf293c550e5849ce6b5dd82189e (patch)
treed55672383c1cbcf17b2e19d1ce469991a8a507af /synapse/federation
parentRaise a SynapseError if the authorisation header is missing or malformed (diff)
downloadsynapse-07639c79d9536cf293c550e5849ce6b5dd82189e.tar.xz
Respond with more helpful error messages for unsigned requests
Diffstat (limited to 'synapse/federation')
-rw-r--r--synapse/federation/transport.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/federation/transport.py b/synapse/federation/transport.py
index 7a4c1f6443..755eee8cf6 100644
--- a/synapse/federation/transport.py
+++ b/synapse/federation/transport.py
@@ -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)