Skip to content
Myr

Minor rfc3986 refactoring (#1157)

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

* Minor rfc3986 refactoring * Update _models.py

authored by Tom Christie · committed by GitHub · parent 4cf74bc · Browse files · 1 file+5 added−5 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+5 added−5 removed

  • other:+5 added−5 removed

1 file+5 added−5 removed

modified:httpx/_models.py+5 added-5 removed
55 unmodified lines
5657class URL:58 def __init__(self, url: URLTypes = "", params: QueryParamTypes = None) -> None:59 if isinstance(url, str):60 self._uri_reference = rfc3986.api.iri_reference(url).encode()60 self._uri_reference = rfc3986.iri_reference(url).encode()61 if self.is_absolute_url:62 # We don't want to normalize relative URLs, since doing so63 # removes any leading `../` portion.64 self._uri_reference = self._uri_reference.normalize()65 else:66 self._uri_reference = url._uri_reference6764 # Normalize scheme and domain name.65 if self.is_absolute_url:66 self._uri_reference = self._uri_reference.normalize()6768 # Add any query parameters, merging with any in the URL if needed.69 if params:70 if self._uri_reference.query:71 url_params = QueryParams(self._uri_reference.query)
1133 unmodified lines