Adds ability to compare multipart bodies while ignoring the boundary#12179
Merged
scbedd merged 3 commits intoAzure:mainfrom Sep 22, 2025
Merged
Adds ability to compare multipart bodies while ignoring the boundary#12179scbedd merged 3 commits intoAzure:mainfrom
scbedd merged 3 commits intoAzure:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds the ability to compare multipart bodies while ignoring the boundary strings, enabling better matching between recorded and playback requests that have different but functionally equivalent boundary values.
- Expanded multipart detection from
multipart/mixedto allmultipart/*types - Added new functionality to remove boundaries from multipart bodies for comparison purposes
- Enhanced header comparison to normalize multipart Content-Type headers by removing boundary values
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
RecordedTestSanitizer.cs |
Changed from IsMultipartMixed to IsMultipart to handle all multipart types |
RecordMatcher.cs |
Added multipart boundary-aware body comparison logic and Content-Type header normalization |
RecordEntry.cs |
Updated to use generic IsMultipart instead of IsMultipartMixed |
MultipartUtilities.cs |
Added boundary removal functionality and ReadOnlySequence utilities |
ContentTypeUtilities.cs |
Refactored to support all multipart types with new IsMultiPart method |
| Test files | Added new test data files for different multipart scenarios |
| Test classes | Updated test methods to use new body comparison signature |
scbedd
reviewed
Sep 20, 2025
small copilot suggestions to comments Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
scbedd
reviewed
Sep 22, 2025
scbedd
approved these changes
Sep 22, 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.
Replaces #11903.
Contributes to #11901.