Skip to content

Commit c6b6de8

Browse files
991761: Replace obsolete Class used in CSP
1 parent 960fb1e commit c6b6de8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ej2-asp-core-mvc/common/EJ2_ASP.NETCORE/content-security-policy.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ using System.Security.Cryptography;
2929
...
3030
app.Use(async (context, next) =>
3131
{
32-
RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
3332
byte[] nonceBytes = new byte[32];
34-
rng.GetBytes(nonceBytes);
33+
RandomNumberGenerator.Fill(nonceBytes);
3534
string nonceValue = Convert.ToBase64String(nonceBytes);
3635
context.Items.Add("ScriptNonce", nonceValue);
3736
context.Response.Headers.Add("Content-Security-Policy", string.Format(

0 commit comments

Comments
 (0)