Change the way request options can affect a request (breaking change)#22
Merged
rickykaare merged 1 commit intomainfrom Jun 6, 2025
Merged
Change the way request options can affect a request (breaking change)#22rickykaare merged 1 commit intomainfrom
rickykaare merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a breaking change in how headers are applied to HTTP requests by replacing the GetHeaders dictionary with a new method, ConfigureHttpRequest, to directly configure the HttpRequestMessage. Key changes include updating the IRequestOptions interface and its implementations in ClientRequestOptions and PagedRequestOptions, as well as adjusting MessageRequestBuilder to use the new approach.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Cabazure.Client.Runtime/PagedRequestOptions.cs | Changed the override method from AppendHeaders to ConfigureHttpRequest and updated header assignment |
| src/Cabazure.Client.Runtime/IRequestOptions.cs | Removed GetHeaders and updated documentation to reflect the new ConfigureHttpRequest method |
| src/Cabazure.Client.Runtime/ClientRequestOptions.cs | Replaced explicit implementation of GetHeaders with ConfigureHttpRequest directly modifying the request |
| src/Cabazure.Client.Runtime/Builder/MessageRequestBuilder.cs | Updated the request building logic to invoke the new ConfigureHttpRequest method if request options are provided |
Comments suppressed due to low confidence (3)
src/Cabazure.Client.Runtime/IRequestOptions.cs:11
- Consider expanding the documentation for ConfigureHttpRequest to clearly describe how header merging and overriding should be handled by implementations.
/// Allows the options implementation to configure the HTTP request message.
src/Cabazure.Client.Runtime/ClientRequestOptions.cs:20
- Clarify in the documentation that this explicit interface implementation applies headers directly to the request object instead of returning a header dictionary, to avoid confusion for API consumers.
void IRequestOptions.ConfigureHttpRequest(HttpRequestMessage request)
src/Cabazure.Client.Runtime/Builder/MessageRequestBuilder.cs:44
- [nitpick] When both manually added headers and request options are used, consider clearly documenting the precedence or merging strategy to avoid potential header conflicts.
if (options is not null)
christianhelle
approved these changes
Jun 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.