Skip to content

Commit

Permalink
Cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
vivet committed Sep 1, 2024
1 parent d23019f commit ad5b121
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Nano.Web/Extensions/ApplicationBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ internal static IApplicationBuilder UseHttpDocumentataion(this IApplicationBuild
var originalIndexHtmlContents = originalStreamReader
.ReadToEnd();
var pattern = "<(script|style)([^>]*)>";
const string PATTERN = "<(script|style)([^>]*)>";
var replacement = $"<$1$2 nonce=\"{webOptions.Documentation.CspNonce}\">";
var nonceEnabledIndexHtmlContents = Regex.Replace(originalIndexHtmlContents, pattern, replacement, RegexOptions.IgnoreCase);
var nonceEnabledIndexHtmlContents = Regex.Replace(originalIndexHtmlContents, PATTERN, replacement, RegexOptions.IgnoreCase);
var bytes = Encoding.UTF8
.GetBytes(nonceEnabledIndexHtmlContents);
Expand Down

0 comments on commit ad5b121

Please sign in to comment.