Skip to content

Commit

Permalink
Patch copy_with
Browse files Browse the repository at this point in the history
  • Loading branch information
lebr0nli committed Apr 21, 2022
1 parent b07fe7b commit ff74890
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion httpx/_urls.py
Expand Up @@ -484,7 +484,9 @@ def copy_with(self, **kwargs: typing.Any) -> "URL":
# \_/ \______________/\_________/ \_________/ \__/
# | | | | |
# scheme authority path query fragment
return URL(self._uri_reference.copy_with(**kwargs).unsplit())
new_url = URL(self)
new_url._uri_reference = self._uri_reference.copy_with(**kwargs)
return URL(new_url)

def copy_set_param(self, key: str, value: typing.Any = None) -> "URL":
return self.copy_with(params=self.params.set(key, value))
Expand Down

0 comments on commit ff74890

Please sign in to comment.