You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
• Expose response trailers separately so callers can distinguish them from regular headers.
• Populate trailers after reading response content on modern .NET targets; default to an empty
collection elsewhere.
• Test multiple trailer values and separation from regular headers.
Keep the separate property and reuse the existing header conversion helper. Merging trailers into regular headers would lose their distinction, while conditional mapping preserves the public API on targets without HttpResponseMessage.TrailingHeaders.
Files changed (3) +45 / -1
Enhancement (2) +9 / -1
RestResponse.csMap available trailers into the completed response+4/-1
Map available trailers into the completed response
• Maps HttpResponseMessage.TrailingHeaders after reading response content on modern .NET targets. Older targets retain the base property's empty default.
ResponseTrailerTests.csVerify trailer values remain separate from regular headers+36/-0
Verify trailer values remain separate from regular headers
• Uses a custom HTTP handler to supply multiple Digest values and another trailer. Verifies their mapping and confirms they do not appear among regular response headers.
Should_map_trailing_headers_separately_from_regular_headers checks that trailers are absent from
Headers but never checks ContentHeaders. When the handler returns its StringContent response,
a mapping that also puts Digest or X-Processing-Status into content headers would still pass
this test.
Rule 4 requires the test to verify separation from both initial and content headers. The new test
checks response.Headers but has no corresponding assertion for response.ContentHeaders.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The trailer regression test verifies separation from regular headers but not content headers.
## Fix Focus Areas
- test/RestSharp.Tests/ResponseTrailerTests.cs[22-24]
## Recommended Fix
Add an assertion that `response.ContentHeaders` contains neither `Digest` nor `X-Processing-Status`.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Tip of the day
💡 Did you know, you can describe a rule in plain language on the Rules page and Qodo drafts it for you
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
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.
Summary
Closes #2413
Tests
The build reports existing NuGet vulnerability warnings for repository dependencies; there are no build errors.