Skip to content

Commit

Permalink
Add coverage for invalid IDNA encoding (#1367)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Oct 21, 2024
1 parent bbb8257 commit 2911088
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ def test_host_subcomponent_return_idna_encoded_host():
assert url.host_subcomponent == "xn----8sb1bdhvc.xn--j1amh"


def test_invalid_idna_hyphen_encoding():
url = URL("http://x-----xn1agdj.tld")
assert url.host == "x-----xn1agdj.tld"


def test_raw_host_non_ascii():
url = URL("http://оун-упа.укр")
assert "xn----8sb1bdhvc.xn--j1amh" == url.raw_host
Expand Down

0 comments on commit 2911088

Please sign in to comment.