From acdacbf18e6d9ecfe4d4cff1eb2b9667694c6b22 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Sun, 18 Feb 2024 17:40:36 +0300 Subject: [PATCH] apps/api: manual headers for fetching from graphql --- apps/api/src/proxy/proxy.controller.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/api/src/proxy/proxy.controller.ts b/apps/api/src/proxy/proxy.controller.ts index afc5790..956c576 100644 --- a/apps/api/src/proxy/proxy.controller.ts +++ b/apps/api/src/proxy/proxy.controller.ts @@ -26,7 +26,11 @@ export class ProxyController { const response = await fetch(env.URL_CRM_GRAPHQL_DIRECT, { body: JSON.stringify({ operationName, query, variables }), - headers: req.headers as HeadersInit, + headers: { + Authorization: req.headers.authorization, + 'Content-Type': 'application/json', + Cookie: req.headers.cookie, + }, method: req.method, });