Skip to content

Commit

Permalink
cr comment
Browse files Browse the repository at this point in the history
  • Loading branch information
nozik committed Jan 28, 2022
1 parent 3564f48 commit a03173f
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,15 @@ def _prepare_headers(headers: typing.Optional[Headers]) -> httpx.Headers:

def _extract_parameters(args, kwargs):
if isinstance(args[0], httpx.Request):
# In httpx >= 0.20.0, handle_request receives a Request object
request: httpx.Request = args[0]
method = request.method.encode()
url = request.url
headers = request.headers
stream = request.stream
extensions = request.extensions
else:
# In httpx < 0.20.0, handle_request receives the parameters separately
method = args[0]
url = args[1]
headers = kwargs.get("headers", args[2] if len(args) > 2 else None)
Expand Down

0 comments on commit a03173f

Please sign in to comment.