Skip to content
Myr

Rely on IRIReference.encode() for IDNA encoding (#210)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Can Sarıgöl · committed by Seth Michael Larson · parent 7156c36 · Browse files · 1 file+0 added−10 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+0 added−10 removed

  • other:+0 added−10 removed

1 file+0 added−10 removed

modified:httpx/models.py-10 removed
90 unmodified lines
91 self._uri_reference = rfc3986.api.iri_reference(url).encode()92 else:93 self._uri_reference = url._uri_reference9495 # Handle IDNA domain names.96 if self._uri_reference.authority:97 idna_authority = self._uri_reference.authority.encode("idna").decode(98 "ascii"99 )100 if idna_authority != self._uri_reference.authority:101 self._uri_reference = self._uri_reference.copy_with(102 authority=idna_authority103 )10495 # Normalize scheme and domain name.96 if self.is_absolute_url:97 self._uri_reference = self._uri_reference.normalize()98
1074 unmodified lines