summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-10-17 21:00:58 +0100
committerErik Johnston <erik@matrix.org>2014-10-17 21:00:58 +0100
commitac9345b47a7c963850369e0a8ad63ed6aaba0795 (patch)
tree04b2f39c91ec6098ffe3b380442787ac3ce2908f
parentMore log lines. (diff)
downloadsynapse-ac9345b47a7c963850369e0a8ad63ed6aaba0795.tar.xz
Check that we have auth headers and fail nicely
-rw-r--r--synapse/federation/transport.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/federation/transport.py b/synapse/federation/transport.py
index 81529baee6..e7517cac4d 100644
--- a/synapse/federation/transport.py
+++ b/synapse/federation/transport.py
@@ -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)