Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Commit 18ad460

Browse files
author
Konstantina Chremmou
committed
Reverted two more C# 6.0 features.
Signed-off-by: Konstantina Chremmou <[email protected]>
1 parent 9c4fc85 commit 18ad460

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

csharp/autogen/src/HTTP.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,11 @@ private static string ComputeHash(string input, string method)
324324

325325
using (var hasher = HashAlgorithm.Create(method))
326326
{
327-
byte[] hash = hasher?.ComputeHash(bytes);
328-
if (hash != null)
327+
if (hasher != null)
328+
{
329+
byte[] hash = hasher.ComputeHash(bytes);
329330
return BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant();
331+
}
330332
}
331333

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

0 commit comments

Comments
 (0)