Repository navigation
Make mock and error-response URL matching case-insensitive - #1934
Open
waldekmastykarz with Copilot wants to merge 3 commits into
Open
waldekmastykarz with Copilot wants to merge 3 commits into
waldekmastykarz with Copilot wants to merge 3 commits into
Conversation
Co-authored-by: waldekmastykarz <11164679+waldekmastykarz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix case-sensitive URL matching in mock and error-response
Make mock and error-response URL matching case-insensitive
Oct 20, 2026
waldekmastykarz
marked this pull request as ready for review
October 20, 2026 17:49
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
Static review found no blocking issues, and regression tests cover exact and wildcard HTTP matching, though tests were not executed.
No open issues 🎉
What changed in this PR
Aligns mock and error-response URL matching with case-insensitive urlsToWatch behavior, addressing #1931.
Changes:
- Makes exact and wildcard URL matching ignore case across four plugins.
- Adds integration tests for mixed-case exact and wildcard matches.
- Updates transitive dependency lock-file entries.
| File | Description |
|---|---|
| DevProxy/packages.lock.json | Updates application dependency records. |
| DevProxy.Proxy.Kestrel/packages.lock.json | Updates proxy dependency records. |
| DevProxy.Plugins/Mocking/WebSocketMockResponsePlugin.cs | Makes wildcard matching case-insensitive. |
| DevProxy.Plugins/Mocking/MockResponsePlugin.cs | Makes exact and wildcard matching case-insensitive. |
| DevProxy.Plugins/Mocking/GraphMockResponsePlugin.cs | Applies case-insensitive matching to batch requests. |
| DevProxy.Plugins/Behavior/GenericRandomErrorPlugin.cs | Makes error-entry URL matching case-insensitive. |
| DevProxy.Integration.Tests/ManipulationAndMockingIntegrationTests.cs | Tests mixed-case mock matching. |
| DevProxy.Integration.Tests/BehaviorPluginsIntegrationTests.cs | Tests mixed-case error matching. |
Review effort: Balanced
This branch has not been deployed
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.
urlsToWatchmatching ignores case, but mock and error-response URL matching was case-sensitive. A request that Dev Proxy intercepted could fail to match a mock or error entry that differed only in casing, and then pass through to the origin with no warning.Changes
MockResponsePlugin,GraphMockResponsePlugin,GenericRandomErrorPlugin: both URL checks now ignore case. The exact-URL check usesStringComparison.OrdinalIgnoreCaseinstead of==, and the wildcard regex usesRegexOptions.IgnoreCase.WebSocketMockResponsePlugin: the wildcard regex now usesRegexOptions.IgnoreCase. Its exact-URL match already ignored case.MockResponsePluginandGenericRandomErrorPlugincheck that a request to/getmatches entries defined as/Get(exact) and/Ge*(wildcard).Behavior
GET https://api.contoso.com/usersnow returns the mock. Before this change, the request was intercepted but no mock matched.Compatibility
Matching is more permissive now. Within each file, entries are still evaluated in order and the first match wins. A mocks or errors file that relies on casing to tell two entries apart will now resolve to whichever of them comes first.