diff options
author | Roland Hedberg <roland.hedberg@adm.umu.se> | 2013-01-19 11:12:34 +0100 |
---|---|---|
committer | Roland Hedberg <roland.hedberg@adm.umu.se> | 2013-01-19 11:12:34 +0100 |
commit | 5845277c7e239d62d16e67cbadfe2fcd99e6e9f3 (patch) | |
tree | 985c94aabb55ced59c535b8daec1f1167a5385ee /src/saml2/pack.py | |
parent | 31df88d813e5b8f711529c975959ae13ab86600f (diff) | |
download | pysaml2-5845277c7e239d62d16e67cbadfe2fcd99e6e9f3.tar.gz |
Better replacement code
Diffstat (limited to 'src/saml2/pack.py')
-rw-r--r-- | src/saml2/pack.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/saml2/pack.py b/src/saml2/pack.py index 2d933b26..6bdc8c40 100644 --- a/src/saml2/pack.py +++ b/src/saml2/pack.py @@ -166,8 +166,10 @@ def make_soap_enveloped_saml_thingy(thingy, header_parts=None): i = _str.find(DUMMY_NAMESPACE) j = _str.rfind("xmlns:", 0, i) cut1 = _str[j:i+len(DUMMY_NAMESPACE)+1] - cut2 = "<%s:FuddleMuddle />" % (cut1[6:9],) _str = _str.replace(cut1, "") + first = _str.find("<%s:FuddleMuddle" % (cut1[6:9],)) + last = _str.find(">", first+14) + cut2 = _str[first:last+1] return _str.replace(cut2,thingy) else: thingy.become_child_element_of(body) |