Skip to content

Commit 021ee79

Browse files
author
Tessa Bloomer
committed
Clarification in comment
1 parent 534974a commit 021ee79

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/onelogin/saml2/response.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ def __decrypt_assertion(self, xml):
870870
def __normalize_url(self, url):
871871
"""
872872
Returns normalized URL for comparison.
873-
This method converts the hostname to lowercase, as it should be case-insensitive (per RFC 4343)
873+
This method converts the netloc to lowercase, as it should be case-insensitive (per RFC 4343, RFC 7617)
874874
If standardization fails, the original URL is returned
875875
Python documentation indicates that URL split also normalizes query strings if empty query fields are present
876876
@@ -882,6 +882,8 @@ def __normalize_url(self, url):
882882
"""
883883
try:
884884
parsed = list(urlsplit(url))
885+
#scheme and hostname converted to lowercase
886+
parsed[0] = parsed[0].lower()
885887
parsed[1] = parsed[1].lower()
886888
normalized_url = urlunsplit(parsed)
887889
return normalized_url

0 commit comments

Comments
 (0)