infinicode 2.8.39 → 2.8.40
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.
|
@@ -119,8 +119,13 @@ export class MeshServer {
|
|
|
119
119
|
res.end(text);
|
|
120
120
|
})
|
|
121
121
|
.catch(err => {
|
|
122
|
-
res.
|
|
123
|
-
|
|
122
|
+
if (!res.headersSent) {
|
|
123
|
+
res.writeHead(502, { 'content-type': 'application/json' });
|
|
124
|
+
res.end(JSON.stringify({ ok: false, error: `scheduler unreachable: ${err instanceof Error ? err.message : String(err)}` }));
|
|
125
|
+
}
|
|
126
|
+
else if (!res.writableEnded) {
|
|
127
|
+
res.end();
|
|
128
|
+
}
|
|
124
129
|
});
|
|
125
130
|
}
|
|
126
131
|
/** Proxy the scheduler's full Control Center and its same-origin assets. */
|
|
@@ -149,11 +154,16 @@ export class MeshServer {
|
|
|
149
154
|
responseHeaders['set-cookie'] = `robopark_auth=${encodeURIComponent(presented)}; Path=/; SameSite=Lax`;
|
|
150
155
|
}
|
|
151
156
|
res.writeHead(upstream.status, responseHeaders);
|
|
152
|
-
res.end(await upstream.arrayBuffer());
|
|
157
|
+
res.end(Buffer.from(await upstream.arrayBuffer()));
|
|
153
158
|
})
|
|
154
159
|
.catch(err => {
|
|
155
|
-
res.
|
|
156
|
-
|
|
160
|
+
if (!res.headersSent) {
|
|
161
|
+
res.writeHead(502, { 'content-type': 'text/plain; charset=utf-8' });
|
|
162
|
+
res.end(`scheduler unreachable: ${err instanceof Error ? err.message : String(err)}`);
|
|
163
|
+
}
|
|
164
|
+
else if (!res.writableEnded) {
|
|
165
|
+
res.end();
|
|
166
|
+
}
|
|
157
167
|
});
|
|
158
168
|
}
|
|
159
169
|
/** Protected local runtime controls for the RoboPark operator dashboard. */
|
package/package.json
CHANGED