use force_str on xml fragment (#44931)
This commit is contained in:
parent
91c57bd9ca
commit
88096a2eca
|
@ -15,9 +15,9 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
from django import template
|
from django import template
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from django.utils.encoding import force_str
|
||||||
from django.utils.six.moves.urllib import parse as urlparse
|
from django.utils.six.moves.urllib import parse as urlparse
|
||||||
|
|
||||||
register = template.Library()
|
register = template.Library()
|
||||||
|
@ -30,7 +30,7 @@ def is_coming_for(request):
|
||||||
next_url = request.GET.get('next')
|
next_url = request.GET.get('next')
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
authn_request = ET.fromstring(request.session['saml:authnRequest'])
|
authn_request = ET.fromstring(force_str(request.session['saml:authnRequest']))
|
||||||
next_url = authn_request.findall(
|
next_url = authn_request.findall(
|
||||||
'{urn:oasis:names:tc:SAML:2.0:protocol}Extensions/{https://www.entrouvert.com/}next_url')[0].text
|
'{urn:oasis:names:tc:SAML:2.0:protocol}Extensions/{https://www.entrouvert.com/}next_url')[0].text
|
||||||
except (KeyError, IndexError):
|
except (KeyError, IndexError):
|
||||||
|
|
Reference in New Issue