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