π¨ The ultimate agentic social media scheduling tool π€
TypeScript nextjsopen-sourceopen-source-social-media-scheduling-toolosspostiz-cloudpostiz-hostedredisscheduling-toolsocial-media-scheduling-tooltypescript
feat: fix header for all agents
Nevo David1bbfa8d603cc
diff --git a/libraries/nestjs-libraries/src/chat/start.mcp.ts b/libraries/nestjs-libraries/src/chat/start.mcp.tsindex 7eff14a5a..6f8afd0fd 100644--- a/libraries/nestjs-libraries/src/chat/start.mcp.ts+++ b/libraries/nestjs-libraries/src/chat/start.mcp.ts@@ -7,6 +7,17 @@ import { OrganizationService } from '@gitroom/nestjs-libraries/database/prisma/oimport { OAuthService } from '@gitroom/nestjs-libraries/database/prisma/oauth/oauth.service';import { runWithContext } from './async.storage';import { createOAuthMiddleware } from './oauth-middleware';+const fixAcceptHeader = (req: Request) => {+ const value = 'application/json, text/event-stream';+ req.headers.accept = value;+ const idx = req.rawHeaders.findIndex((h) => h.toLowerCase() === 'accept');+ if (idx !== -1) {+ req.rawHeaders[idx + 1] = value;+ } else {+ req.rawHeaders.push('Accept', value);+ }+};+export const startMcp = async (app: INestApplication) => {const mastraService = app.get(MastraService, { strict: false });const organizationService = app.get(OrganizationService, { strict: false });@@ -95,6 +106,7 @@ export const startMcp = async (app: INestApplication) => {return;}+ fixAcceptHeader(req);await runWithContext({ requestId: token!, auth }, async () => {await server.startHTTP({url: url,@@ -144,6 +156,7 @@ export const startMcp = async (app: INestApplication) => {const url = new URL('/mcp', process.env.NEXT_PUBLIC_BACKEND_URL);+ fixAcceptHeader(req);// @ts-ignoreawait runWithContext({ requestId: token, auth: req.auth }, async () => {await server.startHTTP({@@ -186,6 +199,7 @@ export const startMcp = async (app: INestApplication) => {process.env.NEXT_PUBLIC_BACKEND_URL);+ fixAcceptHeader(req);await runWithContext(// @ts-ignore{ requestId: req.params.id, auth: req.auth },