Digest authentication exception
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.1k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
The body in the 401 response is not read which makes the authentication to fail, I get the exception ("No colon found.", "header").
If I read the body after the header in the method WsStream::ReadHandshake then it works fine.
if (_innerStream.ReadByte().EqualsWith('\r', add) &&
_innerStream.ReadByte().EqualsWith('\n', add) &&
_innerStream.ReadByte().EqualsWith('\r', add) &&
_innerStream.ReadByte().EqualsWith('\n', add))
{
string tempRes = Encoding.UTF8.GetString(buffer.ToArray());
var clStartIndex = tempRes.IndexOf("Content-Length:");
if (-1 != clStartIndex)
{
clStartIndex += ("Content-Length:".Length + 1);
int crIndex = tempRes.IndexOf('\r', clStartIndex);
string contentLenStr = tempRes.Substring(clStartIndex, crIndex - clStartIndex);
int contentLen = Convert.ToInt32(contentLenStr);
for (int i = 0; i < contentLen; ++i)
{
_innerStream.ReadByte();
}
}
read = true;
break;
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in WsStream::ReadHandshake and reproduce the digest-authentication failure for a 401 response. Trace how the response header and Content-Length are handled, then verify that the response body is consumed before authentication parsing and that the "No colon found." exception no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100