-
-
Notifications
You must be signed in to change notification settings - Fork 808
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
Auth fails for responses that include multiple WWW-Authenticate headers. #1234
Comments
Hello!
|
Perhaps a server-side implementation that's treating the |
I switch to the latest version httpx==0.14.2,It seems bug still exists, I found a camera instance on public network, And I wrote a simple example to illustrate this problem, as follows, I used requests and httpx request the same url, the requests can authentication successfully,but httpx failed.
output:
|
It might be like you said, Is there any way to modify it? |
@beruhan To confirm that case sensitivity is causing this issue, you can try adjusting the request exemple so that it sends If this is confirmed then this would be related to #538. |
like you said,I modified the requests code to lowercase
I don't know way the problem,I debug the authenticate process in requests and httpx as follows:
httpx authenticate process
|
I also modify the code to make camera response header as the same ,
|
Somehow I'd completely missed that this issue is specific to the case when the server sends two WWW-Authenticate headers in the response. And yup, can see how that might pick out a bug on our side, and yup can see how we ought to resolve this. Leaving a link to a useful part of Mozilla's multiple header handling... https://github.com/bnoordhuis/mozilla-central/blob/master/netwerk/protocol/http/nsHttpHeaderArray.h#L185 for my own later reference in this. |
@beruhan Hi, a fix hanlding mulitiple auth headers has been merged, can you try to install from the master branch and confirm if the issue resolved? $ pip install git+https://github.com/encode/httpx.git@master#egg=httpx --upgrade |
Checklist
httpx==0.11.1
Describe the bug
I use httpx request camera mjpeg,The camera response two WWW-Authenticate headers,I used the right username and password,but It response 401. When I user chrome, everything is ok, I doubt the httpx.DigestAuth may have bug when handle digest.
WireShark Data as follows:
request with httpx
request with chrome
The text was updated successfully, but these errors were encountered: