@nitronjs/framework 0.3.9 → 0.3.10
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/lib/View/View.js +6 -6
- package/package.json +1 -1
package/lib/View/View.js
CHANGED
|
@@ -731,8 +731,8 @@ class View {
|
|
|
731
731
|
runtimeScript += `</script>`;
|
|
732
732
|
|
|
733
733
|
if (hasFlightPayload) {
|
|
734
|
-
const
|
|
735
|
-
runtimeScript += `<script${nonceAttr}>window.__NITRON_FLIGHT__=${
|
|
734
|
+
const safePayload = JSON.stringify(flightPayload).replace(/</g, "\\u003c").replace(/>/g, "\\u003e");
|
|
735
|
+
runtimeScript += `<script${nonceAttr}>window.__NITRON_FLIGHT__=${safePayload};</script>`;
|
|
736
736
|
}
|
|
737
737
|
|
|
738
738
|
const refreshScript = this.#isDev
|
|
@@ -823,7 +823,7 @@ ${refreshScript}${vendorScript}${hmrScript}${consumerScript}${spaScript}${devInd
|
|
|
823
823
|
images: hasWildcard ? ["*"] : urls,
|
|
824
824
|
scripts: hasWildcard ? ["*"] : urls,
|
|
825
825
|
connect: hasWildcard ? ["*"] : urls,
|
|
826
|
-
frames: hasWildcard ? ["*"] :
|
|
826
|
+
frames: hasWildcard ? ["*"] : urls,
|
|
827
827
|
};
|
|
828
828
|
}
|
|
829
829
|
else {
|
|
@@ -849,9 +849,9 @@ ${refreshScript}${vendorScript}${hmrScript}${consumerScript}${spaScript}${devInd
|
|
|
849
849
|
const imgSrc = buildSrc(["'self'", "data:", "blob:"], whitelist.images);
|
|
850
850
|
const scriptSrc = buildSrc(["'self'", `'nonce-${nonce}'`], whitelist.scripts);
|
|
851
851
|
const connectSrcFinal = buildSrc([connectSrc], whitelist.connect);
|
|
852
|
-
const frameSrc = whitelist.frames.length
|
|
853
|
-
? (
|
|
854
|
-
: "'
|
|
852
|
+
const frameSrc = whitelist.frames.length
|
|
853
|
+
? buildSrc(["'self'"], whitelist.frames)
|
|
854
|
+
: "'self'";
|
|
855
855
|
|
|
856
856
|
const csp = [
|
|
857
857
|
"default-src 'self'",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nitronjs/framework",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.10",
|
|
4
4
|
"description": "NitronJS is a modern and extensible Node.js MVC framework built on Fastify. It focuses on clean architecture, modular structure, and developer productivity, offering built-in routing, middleware, configuration management, CLI tooling, and native React integration for scalable full-stack applications.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"njs": "./cli/njs.js"
|