summary refs log tree commit diff
path: root/synapse/federation/transport.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-11-10 13:46:44 +0000
committerErik Johnston <erik@matrix.org>2014-11-10 13:46:44 +0000
commit5d439b127ba34b951dfd09a7d3c684c2d50df702 (patch)
treee12a03f22cb0c6b5ca6b0d72f863b288b6a11612 /synapse/federation/transport.py
parentRemove useless comments (diff)
downloadsynapse-5d439b127ba34b951dfd09a7d3c684c2d50df702.tar.xz
PEP8
Diffstat (limited to 'synapse/federation/transport.py')
-rw-r--r--synapse/federation/transport.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/synapse/federation/transport.py b/synapse/federation/transport.py
index d84a44c211..95c40c6c1b 100644
--- a/synapse/federation/transport.py
+++ b/synapse/federation/transport.py
@@ -284,7 +284,7 @@ class TransportLayer(object):
         origin = None
 
         if request.method == "PUT":
-            #TODO: Handle other method types? other content types?
+            # TODO: Handle other method types? other content types?
             try:
                 content_bytes = request.content.read()
                 content = json.loads(content_bytes)
@@ -296,11 +296,13 @@ class TransportLayer(object):
             try:
                 params = auth.split(" ")[1].split(",")
                 param_dict = dict(kv.split("=") for kv in params)
+
                 def strip_quotes(value):
                     if value.startswith("\""):
                         return value[1:-1]
                     else:
                         return value
+
                 origin = strip_quotes(param_dict["origin"])
                 key = strip_quotes(param_dict["key"])
                 sig = strip_quotes(param_dict["sig"])
@@ -321,7 +323,7 @@ class TransportLayer(object):
             if auth.startswith("X-Matrix"):
                 (origin, key, sig) = parse_auth_header(auth)
                 json_request["origin"] = origin
-                json_request["signatures"].setdefault(origin,{})[key] = sig
+                json_request["signatures"].setdefault(origin, {})[key] = sig
 
         if not json_request["signatures"]:
             raise SynapseError(
@@ -515,7 +517,8 @@ class TransportLayer(object):
             return
 
         try:
-            code, response = yield self.received_handler.on_incoming_transaction(
+            handler = self.received_handler
+            code, response = yield handler.on_incoming_transaction(
                 transaction_data
             )
         except: