Projet

Général

Profil

0001-utils-verify-next_url-without-encoding-it.patch

Paul Marillonnet, 06 mai 2019 16:04

Télécharger (996 octets)

Voir les différences:

Subject: [PATCH] utils: verify next_url without encoding it

 src/authentic2/utils.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
src/authentic2/utils.py
890 890

  
891 891

  
892 892
def get_next_url(params, field_name=None):
893
    field_name = field_name or REDIRECT_FIELD_NAME
894 893
    '''Extract and decode a next_url field'''
894
    field_name = field_name or REDIRECT_FIELD_NAME
895 895
    next_url = params.get(field_name)
896 896
    if not next_url:
897 897
        return None
898 898
    try:
899
        next_url = next_url.encode('ascii')
899
        next_url.encode('ascii')
900 900
    except UnicodeEncodeError:
901 901
        return None
902 902
    if not is_valid_url(next_url):
903
-