Skip to content

Commit 946fe95

Browse files
Merge pull request #4641 from syncfusion-content/991761-Replace-obsolete
991761: Replace obsolete Class used in CSP
2 parents b3417b1 + 3474d8c commit 946fe95

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)