diff options
author | Leif Johansson <leifj@sunet.se> | 2012-04-03 11:23:44 +0200 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2012-04-03 11:23:44 +0200 |
commit | 03bcc96c54a277d1d791303e411a72fed8318439 (patch) | |
tree | 86afb0c65c65564f1e31e119327720310a11ca5b /coip | |
parent | 0521b2537d1f02454989a3eb7f84e3fd05ea5016 (diff) |
full path alt
Diffstat (limited to 'coip')
-rw-r--r-- | coip/apps/saml2/views.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/coip/apps/saml2/views.py b/coip/apps/saml2/views.py index c6c9846..2fcde4f 100644 --- a/coip/apps/saml2/views.py +++ b/coip/apps/saml2/views.py @@ -14,16 +14,22 @@ from saml2.metadata import entity_descriptor from saml2.saml import NAME_FORMAT_URI from django.conf import settings +def get_full_path(request,path=None): + if path == None: + path = request.path + full_path = ('http', ('', 's')[request.is_secure()], '://', request.META['HTTP_HOST'], path) + return ''.join(full_path) + def _config(request): host = request.get_host().replace(":","-") c = { - "entityid" : request.build_absolute_uri("/saml2/entity"), + "entityid" : get_full_path(request,"/saml2/entity"), "description": "COIP", "service": { "aa": { "name" : "COIP", "endpoints" : { - "attribute_service" : [(request.build_absolute_uri("/saml2/aq"), BINDING_SOAP)], + "attribute_service" : [(get_full_path(request,"/saml2/aq"), BINDING_SOAP)], }, "policy": { "default": { @@ -45,7 +51,7 @@ def _config(request): "organization": { "display_name": "COIP on %s" % host, "name": "COIP on %s" % host, - "url": request.build_absolute_uri("/"), + "url": get_full_path(request,"/"), }, } return c |