Make certain we do the joining correct

This commit is contained in:
Roland Hedberg
2012-06-30 11:07:03 +02:00
parent ea728b6146
commit 1a17a708a0

View File

@@ -23,6 +23,7 @@ Bindings normally consists of three parts:
- how to package the information
- which protocol to use
"""
import urlparse
import saml2
import base64
import urllib
@@ -96,7 +97,8 @@ def http_redirect_message(message, location, relay_state="",
if relay_state:
args["RelayState"] = relay_state
login_url = "?".join([location, urllib.urlencode(args)])
glue_char = "&" if urlparse.urlparse(location).query else "?"
login_url = glue_char.join([location, urllib.urlencode(args)])
headers = [('Location', login_url)]
body = [""]