@elliemae/pui-cli 8.41.4 → 8.41.5

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.
@@ -81,9 +81,7 @@ const interceptorMiddleware = (fn) => (req, res, next) => {
81
81
  const newResEnd = (...args) => {
82
82
  if (intercept(args[0], args[1])) {
83
83
  isIntercepting = false;
84
- const oldBody = Buffer.concat(args[0]).toString(
85
- "utf-8"
86
- );
84
+ const oldBody = Buffer.concat(chunks).toString("utf-8");
87
85
  if (methods.intercept) {
88
86
  if (typeof methods.intercept !== "function") {
89
87
  throw new Error(
@@ -39,6 +39,7 @@ var import_circular_dependency_plugin = __toESM(require("circular-dependency-plu
39
39
  var import_mini_css_extract_plugin = __toESM(require("mini-css-extract-plugin"), 1);
40
40
  var import_react_refresh_webpack_plugin = __toESM(require("@pmmmwh/react-refresh-webpack-plugin"), 1);
41
41
  var import_express_static_gzip = __toESM(require("express-static-gzip"), 1);
42
+ var import_interceptor_middleware = require("./interceptor-middleware.js");
42
43
  var import_middlewares = require("../server/middlewares.js");
43
44
  var import_appRoutes = require("../server/appRoutes.js");
44
45
  var import_helpers = require("./helpers.js");
@@ -150,6 +151,7 @@ const devConfig = {
150
151
  open: [basePath],
151
152
  port: process.env.PORT || "auto",
152
153
  setupMiddlewares: (middlewares, devServer) => {
154
+ (0, import_interceptor_middleware.addCSPNonceMiddleware)(middlewares);
153
155
  if (devServer.app) {
154
156
  (0, import_middlewares.setupDefaultMiddlewares)(devServer.app);
155
157
  (0, import_appRoutes.loadRoutes)(devServer.app).then(() => {
@@ -57,9 +57,7 @@ const interceptorMiddleware = (fn) => (req, res, next) => {
57
57
  const newResEnd = (...args) => {
58
58
  if (intercept(args[0], args[1])) {
59
59
  isIntercepting = false;
60
- const oldBody = Buffer.concat(args[0]).toString(
61
- "utf-8"
62
- );
60
+ const oldBody = Buffer.concat(chunks).toString("utf-8");
63
61
  if (methods.intercept) {
64
62
  if (typeof methods.intercept !== "function") {
65
63
  throw new Error(
@@ -6,6 +6,7 @@ import CircularDependencyPlugin from "circular-dependency-plugin";
6
6
  import MiniCssExtractPlugin from "mini-css-extract-plugin";
7
7
  import ReactRefreshWebpackPlugin from "@pmmmwh/react-refresh-webpack-plugin";
8
8
  import expressStaticGzip from "express-static-gzip";
9
+ import { addCSPNonceMiddleware } from "./interceptor-middleware.js";
9
10
  import { setupDefaultMiddlewares } from "../server/middlewares.js";
10
11
  import { loadRoutes } from "../server/appRoutes.js";
11
12
  import {
@@ -120,6 +121,7 @@ const devConfig = {
120
121
  open: [basePath],
121
122
  port: process.env.PORT || "auto",
122
123
  setupMiddlewares: (middlewares, devServer) => {
124
+ addCSPNonceMiddleware(middlewares);
123
125
  if (devServer.app) {
124
126
  setupDefaultMiddlewares(devServer.app);
125
127
  loadRoutes(devServer.app).then(() => {