From 5c17a3f00693af803fe1a3f960970f9cd76758d7 Mon Sep 17 00:00:00 2001 From: Steven Yuan Date: Wed, 20 Sep 2023 10:48:48 -0700 Subject: [PATCH] fix(middleware-endpoint-discovery): assert `clientName` and `commandName` in `context` (#5232) --- .../src/endpointDiscoveryMiddleware.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/middleware-endpoint-discovery/src/endpointDiscoveryMiddleware.ts b/packages/middleware-endpoint-discovery/src/endpointDiscoveryMiddleware.ts index 687b82eb7701..ed8146299c4c 100644 --- a/packages/middleware-endpoint-discovery/src/endpointDiscoveryMiddleware.ts +++ b/packages/middleware-endpoint-discovery/src/endpointDiscoveryMiddleware.ts @@ -28,7 +28,8 @@ export const endpointDiscoveryMiddleware = const { endpointDiscoveryCommandCtor } = config; const { isDiscoveredEndpointRequired, identifiers } = middlewareConfig; - const { clientName, commandName } = context; + const clientName = context.clientName!; + const commandName = context.commandName!; const isEndpointDiscoveryEnabled = await config.endpointDiscoveryEnabled(); const cacheKey = await getCacheKey(commandName, config, { identifiers });