Skip to content

RequestAdditionalHeadersAsync not copied to cloned ServiceClient #419

@srinidhivkms

Description

@srinidhivkms

When RequestAdditionalHeadersAsync is used with ServiceClient, the cloned client doesn't have this property copied so if clone is used to make a call, the custom headers are not populated. Can this be checked?

Our client creation and clone logic:

public Task<Dictionary<string, string>> GetAdditionalHeadersAsync()
{
	var headers = new Dictionary<string, string>();
	headers.Add("User-Agent", "abc");
	return Task.FromResult(headers);
}

var connectionOption = new ConnectionOptions()
{
	AccessTokenProviderFunctionAsync = tokenManager.GetToken,
	AuthenticationType = AuthenticationType.ExternalTokenManagement,
	ServiceUri = new Uri(orgUrl),
	RequestAdditionalHeadersAsync = GetAdditionalHeadersAsync,
}
var rootClient = new ServiceClient(connectionOption);
var clone = rootClient.clone();

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions