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:
@@ -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 + '/'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user