Skip to content

Commit

Permalink
Merge pull request #1 from golayp/main
Browse files Browse the repository at this point in the history
fix: better target nonce links
  • Loading branch information
damienbod authored Feb 14, 2024
2 parents 9c367f3 + 8cff0d3 commit ca4bc31
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bff/server/Pages/_Host.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
// 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}\" ";
source = source.Replace("<script ", nonceScript);
var nonceScript = $"<script nonce=\"{nonce}\" src=";
source = source.Replace("<script src=", nonceScript);

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

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

0 comments on commit ca4bc31

Please sign in to comment.