Skip to content

Adds ability to compare multipart bodies while ignoring the boundary#12179

Merged
scbedd merged 3 commits intoAzure:mainfrom
m-nash:mpfdCompare
Sep 22, 2025
Merged

Adds ability to compare multipart bodies while ignoring the boundary#12179
scbedd merged 3 commits intoAzure:mainfrom
m-nash:mpfdCompare

Conversation

@m-nash
Copy link
Copy Markdown
Member

@m-nash m-nash commented Sep 20, 2025

Replaces #11903.
Contributes to #11901.

@m-nash m-nash requested a review from scbedd as a code owner September 20, 2025 00:12
Copilot AI review requested due to automatic review settings September 20, 2025 00:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/mixed to all multipart/* 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

Comment thread tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/MultipartUtilities.cs Outdated
Comment thread tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/RecordMatcher.cs Outdated
Comment thread tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/RecordMatcher.cs Outdated
small copilot suggestions to comments

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Comment thread tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/RecordMatcher.cs
@scbedd scbedd merged commit 668742e into Azure:main Sep 22, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants