Fix URL.host decoding for nested IDNA labels#979
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
9960ca4 to
9bac192
Compare
| host = idna.decode(host) | ||
| if any(label.startswith("xn--") for label in host.split(".")): | ||
| try: | ||
| host = idna.decode(host) |
There was a problem hiding this comment.
you decode the complete host, you should probably try to decode each label and assemble them back together.
See the httpxyz fix at https://codeberg.org/httpxyz/httpxyz/src/commit/dc2bdf61f9d2061d89040dcd4babc1686c5de5bc/httpxyz/_urls.py#L194-L205
There was a problem hiding this comment.
thanks! i've updated accordingly
|
I've opened kjd/idna#248 on idna's side. I don't think we should be handling it on our side. I'll wait for their reply to take a decision here. |
Fixes #850.
Summary
URL.hostidnaexceptions from the propertywww.égalité-femmes-hommes.gouv.fr