-
Notifications
You must be signed in to change notification settings - Fork 606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to pass JavaScript nonce via RenderIncludes() #393
Comments
Yeah we could add this - just so I'm clear - is this asking for a I'm also what @vcsjones thinks on adoption here :) |
Yes, that's correct. |
That seems useful. Would need to make sure that there is no caching of the script tags with the nonce. Perhaps another option to think about would be a factory somewhere, maybe on public Func<HttpContext, string> CspNonceFactory { get; set; } So that you only need to configure it once. It takes an
Nonces are mostly well supported by everything except IE. Edge (the old Edge, not Edgium) does not support nonces on scripts that use |
I'm taking a peek at this now - it'd have to be on the per-provider options which makes things a bit more complicated. That's because |
Hey all, sorry this lingered - how to version the After talking with @mgravell, we decided that the small class allocation on call is okay enough in the scheme of things - it's 1 class allocation and not a big one. I'll likely optimize the writing path in ASP.NET Core specifically as a follow-up (to eliminate the string allocation). Can y'all please see if #465 does what you want here? Now that the blocker is gone, I'd like to merge this and dogfood on Stack Overflow this week before doing a NuGet release. |
Please implement an ability to pass nonce (random string - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) via MiniProfiler.Current.RenderIncludes() method.
This would allow to apply Content-Security-Policy rules on the website and white-list MiniProfiler includes.min.js JavaScript as a safe one.
The text was updated successfully, but these errors were encountered: