@worktango/ai-assistant 0.0.50 → 0.0.51-ryantest
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 -1
- package/package.json +1 -1
package/dist/express.js
CHANGED
|
@@ -11210,7 +11210,14 @@ function setupAiAssistantRoutes(args) {
|
|
|
11210
11210
|
return args.getTargetPath(expressRequest.originalUrl || path);
|
|
11211
11211
|
},
|
|
11212
11212
|
on: {
|
|
11213
|
-
proxyReq:
|
|
11213
|
+
proxyReq: (proxyReq, req) => {
|
|
11214
|
+
args.getBearerToken(req.headers).then((bearerToken) => {
|
|
11215
|
+
proxyReq.setHeader("Authorization", `Bearer ${bearerToken}`);
|
|
11216
|
+
(0, import_http_proxy_middleware.fixRequestBody)(proxyReq, req);
|
|
11217
|
+
}).catch((error) => {
|
|
11218
|
+
logger.error("Error getting bearer token:", error);
|
|
11219
|
+
});
|
|
11220
|
+
},
|
|
11214
11221
|
proxyRes: (proxyRes, req, res) => {
|
|
11215
11222
|
if (req.headers.accept === "text/event-stream") {
|
|
11216
11223
|
res.writeHead(res.statusCode, {
|