@energy8platform/golem 0.1.0 → 0.1.1
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/lib/editor-entry.js
CHANGED
|
@@ -5372,6 +5372,11 @@ data: ${JSON.stringify({ version: v })}
|
|
|
5372
5372
|
res.end("not found");
|
|
5373
5373
|
}
|
|
5374
5374
|
} catch (e) {
|
|
5375
|
+
if (res.headersSent) {
|
|
5376
|
+
console.error(`editor: ${req.method} ${req.url}: ${e.message}`);
|
|
5377
|
+
res.end();
|
|
5378
|
+
return;
|
|
5379
|
+
}
|
|
5375
5380
|
json(res, 500, { isError: true, text: `ERROR: ${e.message}` });
|
|
5376
5381
|
}
|
|
5377
5382
|
});
|
|
@@ -5391,11 +5396,12 @@ data: ${JSON.stringify({ version: v })}
|
|
|
5391
5396
|
res.writeHead(403);
|
|
5392
5397
|
return res.end();
|
|
5393
5398
|
}
|
|
5399
|
+
if (!await stat3(abs).then(() => true, () => false)) return json(res, 404, { isError: true, text: `ERROR: ${url.searchParams.get("rig")} does not exist under ${root2}` });
|
|
5400
|
+
ensureWatch(abs);
|
|
5394
5401
|
res.writeHead(200, { "content-type": "text/event-stream", "cache-control": "no-cache", connection: "keep-alive" });
|
|
5395
5402
|
res.write(`: connected
|
|
5396
5403
|
|
|
5397
5404
|
`);
|
|
5398
|
-
ensureWatch(abs);
|
|
5399
5405
|
(clients.get(abs) ?? clients.set(abs, /* @__PURE__ */ new Set()).get(abs)).add(res);
|
|
5400
5406
|
const hb = setInterval(() => res.write(": hb\n\n"), 15e3);
|
|
5401
5407
|
req.on("close", () => {
|