Rank: Advanced Member
Groups: Developers
Joined: 11/7/2018(UTC) Posts: 303
Thanks: 21 times Was thanked: 5 time(s) in 5 post(s)
|
We have a site where the parent company requires them to implement a CSP. I'm able to handle most of it using NWebSec. I'm able to put a nonce on the code that is output for the script bundles when the site is in release mode, but I need to add nonces to the individual scripts when the site is in debug mode so the site doesn't break if someone has to set it to debug mode for troubleshooting. When the scripts are not bundled, how are they added to the page? I can find the ones like the following: <script src="/Able9B7369Test2/Themes/Sample/Scripts/bootstrap-hover-dropdown.min.js"nonce="Z0zxA+tIUkwo7fv0R7+sBLXv" defer></script> <script src="/Able9B7369Test2/Themes/Sample/Scripts/SmoothScroll.js"nonce="Z0zxA+tIUkwo7fv0R7+sBLXv" defer></script> <script src="/Able9B7369Test2/Themes/Sample/Scripts/custom.js"nonce="Z0zxA+tIUkwo7fv0R7+sBLXv" defer></script>
But I can't find where the standard scripts are added- the ones that would have been bundled, like the following. <script src="/Able9B7369Test2/Scripts/jquery-3.6.0.min.js"></script> <script src="/Able9B7369Test2/Scripts/jquery-ui.min.js"></script> <script src="/Able9B7369Test2/Scripts/jquery.unobtrusive-ajax.min.js"></script> <script src="/Able9B7369Test2/Scripts/jquery.validate.min.js"></script> <script src="/Able9B7369Test2/Scripts/jquery.validate.unobtrusive.min.js"></script> <script src="/Able9B7369Test2/Scripts/bootstrap.min.js"></script> <script src="/Able9B7369Test2/Scripts/jquery.equalheights.js"></script> <script src="/Able9B7369Test2/scripts/expressive.annotations.validate.min.js"></script> <script src="/Able9B7369Test2/Scripts/sweetalert/sweetalert.min.js"></script> <script src="/Able9B7369Test2/Scripts/superfish.js"></script> <script src="/Able9B7369Test2/Scripts/alert-script.js"></script> <script src="/Able9B7369Test2/Scripts/app.js"></script>
Thanks
|
|
|
|
Rank: Advanced Member
Groups: Admin, Developers, Registered, HelpDesk, Authorized User Joined: 10/5/2018(UTC) Posts: 704
Thanks: 5 times Was thanked: 113 time(s) in 112 post(s)
|
Following are the two files where you can find these entries. I am not sure how you could add a nonce attribute.
\Website\App_Start\BundleConfig.cs \Website\Areas\Admin\BundleConfig.cs
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close