May not always want to b64 encode the message

This commit is contained in:
Roland Hedberg 2012-12-22 20:18:46 +01:00
parent 5f91cbc6c3
commit 30e5eec18b

View File

@ -66,9 +66,12 @@ def http_form_post_message(message, location, relay_state="", typ="SAMLRequest")
if not isinstance(message, basestring):
message = "%s" % (message,)
response.append(FORM_SPEC % (location, typ, base64.b64encode(message),
relay_state))
if typ == "SAMLRequest":
_msg = base64.b64encode(message)
else:
_msg = message
response.append(FORM_SPEC % (location, typ, _msg, relay_state))
response.append("""<script type="text/javascript">""")
response.append(" window.onload = function ()")