Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-19083: IDNA prefix should be case insensitive #17726

Open
wants to merge 1 commit into
base: master
from

Conversation

@ZackerySpytz
Copy link
Contributor

ZackerySpytz commented Dec 28, 2019

Any capitalization of "xn--" should be acceptable for the ACE prefix
(see https://tools.ietf.org/html/rfc3490#section-5).

Co-Authored-By: Pepijn de Vos pepijndevos@gmail.com

https://bugs.python.org/issue19083

Any capitalization of "xn--" should be acceptable for the ACE prefix
(see https://tools.ietf.org/html/rfc3490#section-5).

Co-Authored-By: Pepijn de Vos <pepijndevos@gmail.com>
@ZackerySpytz

This comment has been minimized.

Copy link
Contributor Author

ZackerySpytz commented Dec 28, 2019

I plan on adding a news entry.

Copy link
Member

corona10 left a comment

Looks good to me :)

@@ -121,7 +121,7 @@ def ToUnicode(label):
except UnicodeError:
raise UnicodeError("Invalid character in IDN label")
# Step 3: Check for ACE prefix
if not label.startswith(ace_prefix):
if not label.lower().startswith(ace_prefix):

This comment has been minimized.

Copy link
@asvetlov

asvetlov Dec 29, 2019

Contributor

The change is memory and CPU expensive; explicit check for first 3 characters could be much better I believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.