Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2867 from DamirAinullin/master
Browse files Browse the repository at this point in the history
Fix of simple mistakes and typos
  • Loading branch information
thecodejunkie committed Feb 24, 2018
2 parents 11a8609 + 2b58041 commit b7b20aa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Nancy/Cryptography/AesEncryptionProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public string Decrypt(string data)
{
return String.Empty;
}
throw ex;
throw;
}
}
}
Expand Down
9 changes: 5 additions & 4 deletions src/Nancy/Cryptography/DefaultHmacProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ public byte[] GenerateHmac(string data)
/// <returns>Hmac bytes</returns>
public byte[] GenerateHmac(byte[] data)
{
var hmacGenerator = new HMACSHA256(this.key);

return hmacGenerator.ComputeHash(data);
using (var hmacGenerator = new HMACSHA256(this.key))
{
return hmacGenerator.ComputeHash(data);
}
}
}
}
}
3 changes: 1 addition & 2 deletions src/Nancy/Owin/NancyMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ public static MidFunc UseNancy(NancyOptions options = null)
X509Certificate2 certificate = null;
if (options.EnableClientCertificates)
{
var clientCertificate = new X509Certificate2(Get<X509Certificate>(environment, "ssl.ClientCertificate").Export(X509ContentType.Cert));
certificate = clientCertificate ?? null;
certificate = new X509Certificate2(Get<X509Certificate>(environment, "ssl.ClientCertificate").Export(X509ContentType.Cert));
}
var serverClientIp = Get<string>(environment, "server.RemoteIpAddress");
Expand Down

0 comments on commit b7b20aa

Please sign in to comment.