Skip to content

Commit

Permalink
fix nonce scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
damienbod committed Sep 30, 2023
1 parent b1b6ec6 commit ccb27d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/Pages/_Host.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
// The nonce is passed to the client through the HTML to avoid sync issues between tabs
source = source.Replace("**PLACEHOLDER_NONCE_SERVER**", nonce);

var nonceScript = $"<script nonce={nonce} type=";
var nonceScript = $"<script nonce=\"{nonce}\" type=";
source = source.Replace("<script type=", nonceScript);

// link rel="stylesheet"
var nonceLinkStyle = $"<link nonce={nonce} rel=\"stylesheet";
var nonceLinkStyle = $"<link nonce=\"{nonce}\" rel=\"stylesheet";
source = source.Replace("<link rel=\"stylesheet", nonceLinkStyle);

var xsrf = antiForgery.GetAndStoreTokens(HttpContext);
Expand Down

0 comments on commit ccb27d0

Please sign in to comment.