@elliemae/pui-cli 8.41.2 → 8.41.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/server/csp.js
CHANGED
|
@@ -69,11 +69,6 @@ const getScriptSrc = () => {
|
|
|
69
69
|
const scriptSrc = [source, "'strict-dynamic'"];
|
|
70
70
|
return true ? scriptSrc.concat(["'unsafe-eval'"]) : scriptSrc;
|
|
71
71
|
};
|
|
72
|
-
const getStyleSrc = () => {
|
|
73
|
-
const source = (req, res) => `'nonce-${res.locals.cspNonce}'`;
|
|
74
|
-
const scriptSrc = [source, "'strict-dynamic'"];
|
|
75
|
-
return true ? scriptSrc.concat(["'unsafe-inline'"]) : scriptSrc;
|
|
76
|
-
};
|
|
77
72
|
const csp = (app) => {
|
|
78
73
|
app.use((req, res, next) => {
|
|
79
74
|
res.locals.cspNonce = import_crypto.default.randomBytes(32).toString("base64");
|
|
@@ -89,7 +84,6 @@ const csp = (app) => {
|
|
|
89
84
|
frameAncestors: sources,
|
|
90
85
|
objectSrc: ["'none'"],
|
|
91
86
|
scriptSrc: getScriptSrc(),
|
|
92
|
-
styleSrc: getStyleSrc(),
|
|
93
87
|
upgradeInsecureRequests: [],
|
|
94
88
|
reportTo: CSP_REPORT_URI
|
|
95
89
|
},
|
|
@@ -100,7 +100,7 @@ const devConfig = {
|
|
|
100
100
|
// Add development plugins
|
|
101
101
|
plugins: [
|
|
102
102
|
new import_html_webpack_plugin.default({
|
|
103
|
-
inject: !(0, import_helpers.isAppLoaderEnabled)(),
|
|
103
|
+
inject: !(0, import_helpers.isAppLoaderEnabled)() && process.env.CSP !== "true",
|
|
104
104
|
// Inject all files that are generated by webpack, e.g. bundle.js
|
|
105
105
|
template: !(0, import_helpers.isAppLoaderEnabled)() ? "app/index.html" : "app/index-app-loader.html",
|
|
106
106
|
emui: {
|
package/dist/esm/server/csp.js
CHANGED
|
@@ -35,11 +35,6 @@ const getScriptSrc = () => {
|
|
|
35
35
|
const scriptSrc = [source, "'strict-dynamic'"];
|
|
36
36
|
return true ? scriptSrc.concat(["'unsafe-eval'"]) : scriptSrc;
|
|
37
37
|
};
|
|
38
|
-
const getStyleSrc = () => {
|
|
39
|
-
const source = (req, res) => `'nonce-${res.locals.cspNonce}'`;
|
|
40
|
-
const scriptSrc = [source, "'strict-dynamic'"];
|
|
41
|
-
return true ? scriptSrc.concat(["'unsafe-inline'"]) : scriptSrc;
|
|
42
|
-
};
|
|
43
38
|
const csp = (app) => {
|
|
44
39
|
app.use((req, res, next) => {
|
|
45
40
|
res.locals.cspNonce = crypto.randomBytes(32).toString("base64");
|
|
@@ -55,7 +50,6 @@ const csp = (app) => {
|
|
|
55
50
|
frameAncestors: sources,
|
|
56
51
|
objectSrc: ["'none'"],
|
|
57
52
|
scriptSrc: getScriptSrc(),
|
|
58
|
-
styleSrc: getStyleSrc(),
|
|
59
53
|
upgradeInsecureRequests: [],
|
|
60
54
|
reportTo: CSP_REPORT_URI
|
|
61
55
|
},
|
|
@@ -70,7 +70,7 @@ const devConfig = {
|
|
|
70
70
|
// Add development plugins
|
|
71
71
|
plugins: [
|
|
72
72
|
new HtmlWebpackPlugin({
|
|
73
|
-
inject: !isAppLoaderEnabled(),
|
|
73
|
+
inject: !isAppLoaderEnabled() && process.env.CSP !== "true",
|
|
74
74
|
// Inject all files that are generated by webpack, e.g. bundle.js
|
|
75
75
|
template: !isAppLoaderEnabled() ? "app/index.html" : "app/index-app-loader.html",
|
|
76
76
|
emui: {
|