Skip to content

Commit

Permalink
Remove double setting of caller-type header
Browse files Browse the repository at this point in the history
  • Loading branch information
pdoerner committed Oct 12, 2023
1 parent 3f36e1d commit a68c160
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions headersprovider/headers_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package headersprovider

import (
"context"

h "github.com/temporalio/cli/headers"
)

type HeadersProvider interface {
Expand All @@ -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) {
Expand Down

0 comments on commit a68c160

Please sign in to comment.