Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions csharp/autogen/src/HTTP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,11 @@ private static string ComputeHash(string input, string method)

using (var hasher = HashAlgorithm.Create(method))
{
byte[] hash = hasher?.ComputeHash(bytes);
if (hash != null)
if (hasher != null)
{
byte[] hash = hasher.ComputeHash(bytes);
return BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant();
}
}

return null;
Expand Down Expand Up @@ -590,7 +592,8 @@ private static void AuthenticateProxy(ref Stream stream, Uri uri, IWebProxy prox
if (qops.Length > 0)
{
qop = qops.FirstOrDefault(q => q.ToLowerInvariant() == "auth") ??
qops.FirstOrDefault(q => q.ToLowerInvariant() == "auth-int") ??
qops.FirstOrDefault(q => q.ToLowerInvariant() == "auth-int");
if (qop == null)
throw new ProxyServerAuthenticationException(
"Digest authentication's quality-of-protection directive is not supported.");
authenticationFieldReply += string.Format(", qop={0}", qop); //unquoted; see RFC7616-3.4
Expand Down