Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Don't clear digest info unnecessarily when only a single realm is involved #3267
It looks like #2272 took a bit of a nuclear approach to solving this problem, which prevents me from continuing to reuse the session. It must reauthenticate each time if I'm talking to the same realm.
On subsequent requests the Authentication header is missing forcing a reauthentication. I don't expect this if I'm only using a single curl object for a single realm. Technically the reauthentication doesn't prevent the request from going through, but it certainly is less efficient requiring an extra handshake for each request.
The offending line is here.
I verified my app works perfectly when not reseting the digest info. The nc increments perfectly with each request and it never gets any additional 401s after the initial authentication.
I did this
suppose url and userpswd don't change.
I expected the following
This should only authenticate once.
The first time I expect the server to return 401 with WWW-Authenticate header.