mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
This allows us to support a more flexible set of CSP rules that do not necessarily rely on nonce.
This commit is contained in:
parent
3fc0a9edfb
commit
ef82aaf7df
3 changed files with 5 additions and 3 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
var kbnCsp = JSON.parse(document.querySelector('kbn-csp').getAttribute('data'));
|
||||||
|
window.__kbnStrictCsp__ = kbnCsp.strictCsp;
|
||||||
|
window.__webpack_nonce__ = kbnCsp.nonce;
|
||||||
|
|
||||||
if (window.__kbnStrictCsp__ && window.__kbnCspNotEnforced__) {
|
if (window.__kbnStrictCsp__ && window.__kbnCspNotEnforced__) {
|
||||||
var legacyBrowserError = document.getElementById('kbn_legacy_browser_error');
|
var legacyBrowserError = document.getElementById('kbn_legacy_browser_error');
|
||||||
legacyBrowserError.style.display = 'flex';
|
legacyBrowserError.style.display = 'flex';
|
||||||
|
|
|
@ -118,5 +118,6 @@ html(lang=locale)
|
||||||
style#themeCss
|
style#themeCss
|
||||||
|
|
||||||
body
|
body
|
||||||
|
kbn-csp(data=JSON.stringify({ nonce, strictCsp }))
|
||||||
kbn-injected-metadata(data=JSON.stringify(injectedMetadata))
|
kbn-injected-metadata(data=JSON.stringify(injectedMetadata))
|
||||||
block content
|
block content
|
||||||
|
|
|
@ -137,7 +137,4 @@ block content
|
||||||
// intentional as we check for the existence of __kbnCspNotEnforced__ in
|
// intentional as we check for the existence of __kbnCspNotEnforced__ in
|
||||||
// bootstrap.
|
// bootstrap.
|
||||||
window.__kbnCspNotEnforced__ = true;
|
window.__kbnCspNotEnforced__ = true;
|
||||||
script(nonce=nonce).
|
|
||||||
window.__kbnStrictCsp__ = !{strictCsp};
|
|
||||||
window.__webpack_nonce__ = '!{nonce}';
|
|
||||||
script(src=bootstrapScriptUrl, nonce=nonce)
|
script(src=bootstrapScriptUrl, nonce=nonce)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue