Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up keyword argument name, using URL.join(url=...), not URL.join(relative_url=...). #1129

Merged
merged 2 commits into from
Aug 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion httpx/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def _merge_url(self, url: URLTypes) -> URL:
Merge a URL argument together with any 'base_url' on the client,
to create the URL used for the outgoing request.
"""
return self.base_url.join(relative_url=url)
return self.base_url.join(url)

def _merge_cookies(
self, cookies: CookieTypes = None
Expand Down
6 changes: 3 additions & 3 deletions httpx/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,17 @@ def copy_with(self, **kwargs: typing.Any) -> "URL":

return URL(self._uri_reference.copy_with(**kwargs).unsplit(),)

def join(self, relative_url: URLTypes) -> "URL":
def join(self, url: URLTypes) -> "URL":
"""
Return an absolute URL, using given this URL as the base.
"""
if self.is_relative_url:
return URL(relative_url)
return URL(url)

# We drop any fragment portion, because RFC 3986 strictly
# treats URLs with a fragment portion as not being absolute URLs.
base_uri = self._uri_reference.copy_with(fragment=None)
relative_url = URL(relative_url)
relative_url = URL(url)
return URL(relative_url._uri_reference.resolve_with(base_uri).unsplit())

def __hash__(self) -> int:
Expand Down