Get OpenID XRDS url host from request

Replaced the previous method of getting it from HTTP_POST to use
django's mechanism, which may or may not use HTTP_HOST. However if an
attacker changes the request header, there is not much he can do since
he cannot recreate the association nonce.
This commit is contained in:
Carlos Andrés Rocha
2012-10-03 17:16:22 -04:00
parent 4840de8c88
commit e62968d5e1

View File

@@ -271,10 +271,7 @@ def get_xrds_url(resource, request):
"""
Return the XRDS url for a resource
"""
host = request.META['HTTP_HOST']
if not host.endswith('edx.org'):
return None
host = request.get_host()
location = host + '/openid/provider/' + resource + '/'