diff --git a/docs/Releases.md b/docs/Releases.md
index cd85345ea..f81853234 100644
--- a/docs/Releases.md
+++ b/docs/Releases.md
@@ -6,6 +6,8 @@ layout: "default"
This page tracks major changes included in any update starting with version 4.0.0.3
#### Unreleased
+- **New**:
+ - Support for strict CSP (dynamic inline styles removed) ([#634](https://github.com/MiniProfiler/dotnet/pull/634) - thanks [rwasef1830](https://github.com/rwasef1830))
- **Fixes/Changes**:
- Upgraded MongoDB driver, allowing automatic index creation and profiler expiration ([#613](https://github.com/MiniProfiler/dotnet/pull/613) - thanks [IanKemp](https://github.com/IanKemp))
diff --git a/samples/Samples.AspNet/Helpers/NonceService.cs b/samples/Samples.AspNet/Helpers/NonceService.cs
new file mode 100644
index 000000000..3c7ac3ba9
--- /dev/null
+++ b/samples/Samples.AspNet/Helpers/NonceService.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Security.Cryptography;
+using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Samples.AspNetCore
+{
+ ///
+ /// Nonce service (custom implementation) for sharing a random nonce for the lifetime of a request.
+ ///
+ public class NonceService
+ {
+ public string RequestNonce { get; } = Convert.ToBase64String(RandomNumberGenerator.GetBytes(64));
+ }
+
+ public static class NonceExtensions
+ {
+ public static string? GetNonce(this HttpContext context) => context.RequestServices.GetService()?.RequestNonce;
+ }
+}
diff --git a/samples/Samples.AspNet/Pages/RazorPagesSample.cshtml b/samples/Samples.AspNet/Pages/RazorPagesSample.cshtml
index 1cd9cf6d3..9c315856c 100644
--- a/samples/Samples.AspNet/Pages/RazorPagesSample.cshtml
+++ b/samples/Samples.AspNet/Pages/RazorPagesSample.cshtml
@@ -13,7 +13,7 @@
@section scripts {
- ");
- sb.Append(Includes(profiler, path: path, isAuthorized: true));
+ sb.Append(Includes(profiler, path: path, isAuthorized: true, nonce: nonce));
sb.Append(@"