Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RequestOptions Add Header method #2265

Closed
j82w opened this issue Mar 1, 2021 · 1 comment · Fixed by #2371
Closed

RequestOptions Add Header method #2265

j82w opened this issue Mar 1, 2021 · 1 comment · Fixed by #2371
Labels
API_REVIEW discussion-wanted Need a discussion on an area

Comments

@j82w
Copy link
Contributor

j82w commented Mar 1, 2021

The Encryption SDK, internal compute services, and even customers may want to add customer headers so they can correlate their request to Cosmos operations. The RequestOptions.Properties is meant for the client context and is not meant for adding headers.

The suggested public API

public class RequestOptions
{
     public Action<Header> RequestHeaders { get; set; }
}
@j82w j82w added discussion-wanted Need a discussion on an area API_REVIEW labels Mar 1, 2021
@j82w
Copy link
Contributor Author

j82w commented Mar 4, 2021

ItemRequestOptions clone = (ItemRequestOptions)this.MemberwiseClone();
if(other.RequestHeaders != null){
    clone.RequestHeaders += AddEncryptionHeader;
}else{
    clone.RequestHeaders = AddEncryptionHeader;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API_REVIEW discussion-wanted Need a discussion on an area
Projects
None yet
1 participant