From c531f4dd3e2f5e67d37d4ad5324663829b7cea09 Mon Sep 17 00:00:00 2001 From: Eric Wittmann Date: Wed, 13 Nov 2024 08:40:05 -0500 Subject: [PATCH] workaround compression issue --- typescript-sdk/lib/sdk/factory.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/typescript-sdk/lib/sdk/factory.ts b/typescript-sdk/lib/sdk/factory.ts index ce04adb807..fdb60242d8 100644 --- a/typescript-sdk/lib/sdk/factory.ts +++ b/typescript-sdk/lib/sdk/factory.ts @@ -5,7 +5,7 @@ import { ParseNodeFactoryRegistry, ParseNodeFactory, type SerializationWriterFactory } from "@microsoft/kiota-abstractions"; -import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary"; +import { FetchRequestAdapter, HeadersInspectionHandler, KiotaClientFactory, ParametersNameDecodingHandler, RedirectHandler, RetryHandler, UserAgentHandler } from "@microsoft/kiota-http-fetchlibrary"; import { JsonParseNodeFactory, JsonSerializationWriterFactory } from "@microsoft/kiota-serialization-json"; import { ApicurioRegistryClient, createApicurioRegistryClient } from "../generated-client/apicurioRegistryClient.ts"; import { @@ -32,7 +32,10 @@ export class RegistryClientFactory { if (authProvider === undefined || authProvider === null) { authProvider = new AnonymousAuthenticationProvider(); } - const requestAdapter: RequestAdapter = new FetchRequestAdapter(authProvider, localParseNodeFactory, localSerializationWriterFactory); + const http = KiotaClientFactory.create(undefined, [ + new RetryHandler(), new RedirectHandler(), new ParametersNameDecodingHandler(), new UserAgentHandler(), new HeadersInspectionHandler() + ]); + const requestAdapter: RequestAdapter = new FetchRequestAdapter(authProvider, localParseNodeFactory, localSerializationWriterFactory, http); requestAdapter.baseUrl = baseUrl; return createApicurioRegistryClient(requestAdapter); }