From ddbe42fdd003076a43e99f4c7da3c86a55c24eb3 Mon Sep 17 00:00:00 2001 From: pdoerner <122412190+pdoerner@users.noreply.github.com> Date: Fri, 13 Oct 2023 12:43:24 -0700 Subject: [PATCH] Remove double setting of caller-type header (#355) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What was changed Removed setting of `caller-type` header from `headers_provider` because it is already being set as part of `cliVersionHeaders` so the value was getting appended twice. ## Why? No need to set the same value twice ## Checklist 1. Closes 2. How was this tested: Existing tests and quick local validation 3. Any docs updates needed? --- headersprovider/headers_provider.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/headersprovider/headers_provider.go b/headersprovider/headers_provider.go index 79c1d6b5..a39d9fac 100644 --- a/headersprovider/headers_provider.go +++ b/headersprovider/headers_provider.go @@ -2,8 +2,6 @@ package headersprovider import ( "context" - - h "github.com/temporalio/cli/headers" ) type HeadersProvider interface { @@ -18,18 +16,12 @@ type grpcHeaderProvider struct { headers map[string]string } -func newGrpcHeaderProvider(headers map[string]string) *grpcHeaderProvider { - provider := &grpcHeaderProvider{headers} - provider.headers[h.CallerTypeHeaderName] = h.CallerTypeHeaderCLI - return provider -} - func (a grpcHeaderProvider) GetHeaders(ctx context.Context) (map[string]string, error) { return a.headers, nil } func SetGRPCHeadersProvider(headers map[string]string) { - headersProvider = newGrpcHeaderProvider(headers) + headersProvider = &grpcHeaderProvider{headers} } func SetCurrent(hp HeadersProvider) {