summary refs log tree commit diff
path: root/synapse/rest/client/v1/login.py
diff options
context:
space:
mode:
authorSteven Hammerton <steven.hammerton@openmarket.com>2015-10-12 16:02:17 +0100
committerSteven Hammerton <steven.hammerton@openmarket.com>2015-10-12 16:02:17 +0100
commit739464fbc5dc328001fcc71e327938229c836204 (patch)
treecfdc5fac70ad2cefba30998501926d720514b23f /synapse/rest/client/v1/login.py
parentUnpack dictionary in for loop for nicer syntax (diff)
downloadsynapse-739464fbc5dc328001fcc71e327938229c836204.tar.xz
Add a comment to clarify why we split on closing curly brace when reading CAS attribute tags
Diffstat (limited to 'synapse/rest/client/v1/login.py')
-rw-r--r--synapse/rest/client/v1/login.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/rest/client/v1/login.py b/synapse/rest/client/v1/login.py
index c92dedcc0f..2e3e4f39f3 100644
--- a/synapse/rest/client/v1/login.py
+++ b/synapse/rest/client/v1/login.py
@@ -177,6 +177,11 @@ class LoginRestServlet(ClientV1RestServlet):
             if child.tag.endswith("attributes"):
                 attributes = {}
                 for attribute in child:
+                    # ElementTree library expands the namespace in attribute tags
+                    # to the full URL of the namespace.
+                    # See (https://docs.python.org/2/library/xml.etree.elementtree.html)
+                    # We don't care about namespace here and it will always be encased in
+                    # curly braces, so we remove them.
                     if "}" in attribute.tag:
                         attributes[attribute.tag.split("}")[1]] = attribute.text
                     else: