infinicode 2.8.40 → 2.8.41
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.
|
@@ -262,13 +262,9 @@ export class MeshServer {
|
|
|
262
262
|
return;
|
|
263
263
|
}
|
|
264
264
|
const remote = req.socket.remoteAddress ?? 'unknown';
|
|
265
|
-
// The
|
|
266
|
-
//
|
|
265
|
+
// The mesh node serves the full Park-enabled RoboPark Control Center. Its
|
|
266
|
+
// product APIs remain proxied under /robopark/* to the scheduler.
|
|
267
267
|
if (req.method === 'GET' && (path === '/' || path === '/ui' || path === '/dashboard')) {
|
|
268
|
-
if (this.opts.schedulerUrl) {
|
|
269
|
-
this.proxySchedulerPath(req, res, '/');
|
|
270
|
-
return;
|
|
271
|
-
}
|
|
272
268
|
if (!this.opts.dashboardHtml) {
|
|
273
269
|
res.writeHead(404).end('dashboard not enabled (start with --dashboard)');
|
|
274
270
|
return;
|
|
@@ -288,15 +284,16 @@ export class MeshServer {
|
|
|
288
284
|
res.writeHead(404).end('mesh dashboard not enabled (start with --dashboard)');
|
|
289
285
|
return;
|
|
290
286
|
}
|
|
291
|
-
res.writeHead(200, {
|
|
287
|
+
res.writeHead(200, {
|
|
288
|
+
'content-type': 'text/html; charset=utf-8',
|
|
289
|
+
'cache-control': 'no-store',
|
|
290
|
+
...(this.opts.token && this.presentedToken(req)
|
|
291
|
+
? { 'set-cookie': `robopark_auth=${encodeURIComponent(this.presentedToken(req))}; Path=/; SameSite=Lax` }
|
|
292
|
+
: {}),
|
|
293
|
+
});
|
|
292
294
|
res.end(this.opts.dashboardHtml);
|
|
293
295
|
return;
|
|
294
296
|
}
|
|
295
|
-
// Full scheduler dashboard requests are same-origin after the root proxy.
|
|
296
|
-
if (this.opts.schedulerUrl && (path.startsWith('/api/') || path.startsWith('/static/') || path.startsWith('/vendor/'))) {
|
|
297
|
-
this.proxySchedulerPath(req, res, path);
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
297
|
// Static assets bundled with the dashboard (robot concept avatars, etc.).
|
|
301
298
|
if (req.method === 'GET' && path.startsWith('/static/')) {
|
|
302
299
|
const asset = loadStaticAsset(path.slice(8));
|
package/package.json
CHANGED