From 9e7497698e9ec45f4be5e3ef226e734d78cd3927 Mon Sep 17 00:00:00 2001 From: Jhonatan Sandoval Velasco <122501764+JhontSouth@users.noreply.github.com> Date: Fri, 22 Dec 2023 11:31:37 -0500 Subject: [PATCH] include http method in fetch request (#4593) --- .../botframework-connector/src/auth/botFrameworkClientImpl.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/botframework-connector/src/auth/botFrameworkClientImpl.ts b/libraries/botframework-connector/src/auth/botFrameworkClientImpl.ts index 69d743899b..616cbb0615 100644 --- a/libraries/botframework-connector/src/auth/botFrameworkClientImpl.ts +++ b/libraries/botframework-connector/src/auth/botFrameworkClientImpl.ts @@ -9,13 +9,15 @@ import { ServiceClientCredentialsFactory } from './serviceClientCredentialsFacto import { USER_AGENT } from './connectorFactoryImpl'; import { WebResource } from '@azure/core-http'; import { ok } from 'assert'; +import fetch from 'cross-fetch'; const botFrameworkClientFetchImpl: typeof fetch = async (input, init) => { const url = z.string().parse(input); const { body, headers } = z.object({ body: z.string(), headers: z.record(z.string()).optional() }).parse(init); const response = await fetch(url, { - body: JSON.parse(body), + method: 'POST', + body, headers, });