From 3474d8c5e4ccc10b770a532103f2ee910b0a38ea Mon Sep 17 00:00:00 2001 From: AthiswaranVeerasekaran Date: Fri, 7 Nov 2025 20:38:45 +0530 Subject: [PATCH] 991761: Replace obsolete Class used in CSP --- .../common/EJ2_ASP.NETCORE/content-security-policy.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ej2-asp-core-mvc/common/EJ2_ASP.NETCORE/content-security-policy.md b/ej2-asp-core-mvc/common/EJ2_ASP.NETCORE/content-security-policy.md index e845898604..96401b6de2 100644 --- a/ej2-asp-core-mvc/common/EJ2_ASP.NETCORE/content-security-policy.md +++ b/ej2-asp-core-mvc/common/EJ2_ASP.NETCORE/content-security-policy.md @@ -29,9 +29,8 @@ using System.Security.Cryptography; ... app.Use(async (context, next) => { - RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); byte[] nonceBytes = new byte[32]; - rng.GetBytes(nonceBytes); + RandomNumberGenerator.Fill(nonceBytes); string nonceValue = Convert.ToBase64String(nonceBytes); context.Items.Add("ScriptNonce", nonceValue); context.Response.Headers.Add("Content-Security-Policy", string.Format(