@worktango/ai-assistant 0.0.100-beta.james.3 → 0.0.100-beta.james.4
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/express.js +6 -14
- package/package.json +1 -1
package/dist/express.js
CHANGED
|
@@ -10270,15 +10270,12 @@ function setupAiAssistantRoutes(args) {
|
|
|
10270
10270
|
(0, import_http_proxy_middleware.fixRequestBody)(proxyReq, req);
|
|
10271
10271
|
},
|
|
10272
10272
|
proxyRes: (proxyRes, req, res) => {
|
|
10273
|
-
|
|
10274
|
-
|
|
10275
|
-
|
|
10276
|
-
|
|
10277
|
-
|
|
10278
|
-
|
|
10279
|
-
console.log("PROXY REq", req.statusCode);
|
|
10280
|
-
console.log("PROXY REq", req.statusCode);
|
|
10281
|
-
console.log("PROXY REq", req.statusCode);
|
|
10273
|
+
if (proxyRes.statusCode !== 200) {
|
|
10274
|
+
logger.error(`Proxy status ${proxyRes.statusCode}:`, {
|
|
10275
|
+
proxyResURL: proxyRes.url,
|
|
10276
|
+
reqURL: req.url
|
|
10277
|
+
});
|
|
10278
|
+
}
|
|
10282
10279
|
if (req.headers.accept === "text/event-stream") {
|
|
10283
10280
|
res.writeHead(res.statusCode, {
|
|
10284
10281
|
"Content-Type": "text/event-stream",
|
|
@@ -10288,11 +10285,6 @@ function setupAiAssistantRoutes(args) {
|
|
|
10288
10285
|
}
|
|
10289
10286
|
},
|
|
10290
10287
|
error: (err, req, res) => {
|
|
10291
|
-
console.log("PROXY ERROR", err);
|
|
10292
|
-
console.log("PROXY ERROR", err);
|
|
10293
|
-
console.log("PROXY ERROR", err);
|
|
10294
|
-
console.log("PROXY ERROR", err);
|
|
10295
|
-
console.log("PROXY ERROR", err);
|
|
10296
10288
|
logger.error("Proxy error:", err);
|
|
10297
10289
|
if ("headersSent" in res && !res.headersSent) {
|
|
10298
10290
|
res.statusCode = 502;
|