feat: Add CSP configuration to use CSPMiddleware and CSP nonce to script tags in several cshtml script
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
@using DigitalData.Core.DTO;
|
||||
@{
|
||||
var nonce = _accessor.HttpContext?.Items["csp-nonce"] as string;
|
||||
}
|
||||
@using DigitalData.Core.DTO;
|
||||
@using EnvelopeGenerator.Application.DTOs;
|
||||
@model EnvelopeReceiverDto;
|
||||
@{
|
||||
@@ -42,7 +45,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
<script nonce="@nonce">
|
||||
const collapseNav = () => {
|
||||
document.addEventListener('click', function (event) {
|
||||
var navbarToggle = document.getElementById('navbarToggleExternalContent');
|
||||
@@ -66,7 +69,7 @@
|
||||
|
||||
var envelopeKey = ViewData["EnvelopeKey"] as string;
|
||||
|
||||
<script>
|
||||
<script nonce="@nonce">
|
||||
var base64String = "@Html.Raw(documentBase64String.TrySanitize(_sanitizer))";
|
||||
var byteCharacters = atob(base64String);
|
||||
var byteNumbers = new Array(byteCharacters.length);
|
||||
@@ -82,5 +85,4 @@
|
||||
})
|
||||
</script>
|
||||
}
|
||||
|
||||
<div id='app' style='background: gray; width: 100vw; height: 100vh; margin: 0 auto;'></div>
|
||||
Reference in New Issue
Block a user