@lasso-ai/cli 1.0.5 → 1.0.6
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.
|
@@ -70,6 +70,7 @@ void (async () => {
|
|
|
70
70
|
const contentType = String(proxyRes.headers["content-type"] || "");
|
|
71
71
|
const headers = { ...proxyRes.headers };
|
|
72
72
|
delete headers["content-length"];
|
|
73
|
+
delete headers["content-encoding"];
|
|
73
74
|
res.writeHead(proxyRes.statusCode || 200, headers);
|
|
74
75
|
res.end(contentType.includes("text/html")
|
|
75
76
|
? body.replace("</head>", `<script src="/__lasso/overlay.js?bridgePort=${bridgePort}"></script></head>`)
|
|
@@ -82,7 +83,7 @@ void (async () => {
|
|
|
82
83
|
res.end(node_fs_1.default.readFileSync(bundlePath, "utf8"));
|
|
83
84
|
return;
|
|
84
85
|
}
|
|
85
|
-
proxy.web(req, res, {}, (error) => {
|
|
86
|
+
proxy.web(req, res, { headers: { "accept-encoding": "identity" } }, (error) => {
|
|
86
87
|
if (!res.headersSent) {
|
|
87
88
|
res.writeHead(502, { "content-type": "text/plain" });
|
|
88
89
|
res.end(`Next.js is still starting: ${error.message}`);
|
package/dist/cli/server/next.js
CHANGED
|
@@ -39,7 +39,10 @@ async function startNextServer(cwd) {
|
|
|
39
39
|
proxyRes.on("end", () => {
|
|
40
40
|
const body = Buffer.concat(chunks).toString("utf-8");
|
|
41
41
|
const contentType = proxyRes.headers["content-type"] || "";
|
|
42
|
-
|
|
42
|
+
const headers = { ...proxyRes.headers };
|
|
43
|
+
delete headers["content-length"];
|
|
44
|
+
delete headers["content-encoding"];
|
|
45
|
+
res.writeHead(proxyRes.statusCode || 200, headers);
|
|
43
46
|
if (contentType.includes("text/html")) {
|
|
44
47
|
res.end(body.replace("</head>", `<script src="/__lasso/overlay.js?bridgePort=3056"></script></head>`));
|
|
45
48
|
}
|
|
@@ -55,7 +58,7 @@ async function startNextServer(cwd) {
|
|
|
55
58
|
serveOverlayBundle(res);
|
|
56
59
|
return;
|
|
57
60
|
}
|
|
58
|
-
proxy.web(req, res, {}, (err) => {
|
|
61
|
+
proxy.web(req, res, { headers: { "accept-encoding": "identity" } }, (err) => {
|
|
59
62
|
console.error(chalk_1.default.red("Proxy error:"), err.message);
|
|
60
63
|
res.writeHead(502);
|
|
61
64
|
res.end("Bad gateway — is the Next.js dev server still starting up?");
|
package/package.json
CHANGED