You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bug is reproducible against the latest release: 0.14.3.
There are no similar issues or pull requests to fix it yet: that I could find....
Describe the bug
Client.stream seems to not use auth as provided in the initializer of Client objects.
To reproduce
Create an httpx.Client object with auth set.
cli = httpx.Client(auth=("user", "password"))
Check that the client.get/post works ok.
url = "<url to smallish file>"
resp = cli.get(url)
resp.raise_for_status() # no error is raised
Then try Client.stream normally.
with cli.stream("GET", url) as resp:
resp.raise_for_status() # HTTPStatusError 401 is raised
....
Try Client.stream with auth.
with cli.stream("GET", url, auth=cli.auth) as resp:
resp.raise_for_status() # no error is raised
....
Expected behavior
auth is used by method Client.stream.
Actual behavior
auth is not used by method Client.stream.
Environment
OS:
Python version
HTTPX version:
Python 3.7.7 (default, May 16 2020, 11:38:23)
[GCC 10.1.1 20200507 (Red Hat 10.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import httpx
>>> httpx.__version__
'0.14.3'
>>>
Async environment: sync
HTTP proxy: no
Custom certificates: no
The text was updated successfully, but these errors were encountered:
With version 0.15.0, I can reproduce the issue. On one of our packages using both the stream function and authentication, we had to make a fix to pass the authentication to the client.stream method directly rather than to the httpx.Client.
Checklist
Describe the bug
Client.stream seems to not use auth as provided in the initializer of Client objects.
To reproduce
cli = httpx.Client(auth=("user", "password"))
Expected behavior
auth is used by method Client.stream.
Actual behavior
auth is not used by method Client.stream.
Environment
The text was updated successfully, but these errors were encountered: