Skip to content

Mock and error-response URL matching is case-sensitive while urlsToWatch is case-insensitive #1931

Closed

Description

@waldekmastykarz

Description

URL matching is case-insensitive in urlsToWatch, but case-sensitive in the mock and error-response files. A URL that Dev Proxy intercepts may therefore quietly fail to match a mock or error entry when only its casing differs.

Evidence

Case-insensitive:

  • urlsToWatch: DevProxy/Plugins/PluginServiceExtensions.cs (ConvertToRegex uses RegexOptions.IgnoreCase)
  • RewritePlugin: DevProxy.Plugins/Manipulation/RewritePlugin.cs (regex with IgnoreCase)
  • OpenAPI / API Center URL matching (prefix comparisons ignore case)

Case-sensitive (no IgnoreCase):

  • MockResponsePlugin: DevProxy.Plugins/Mocking/MockResponsePlugin.cs:322 (Regex.IsMatch(request.Url, ProxyUtils.PatternToRegex(...)))
  • GraphMockResponsePlugin: DevProxy.Plugins/Mocking/GraphMockResponsePlugin.cs:206
  • GenericRandomErrorPlugin errors file: DevProxy.Plugins/Behavior/GenericRandomErrorPlugin.cs:206

Steps to reproduce

  1. Set urlsToWatch to https://api.contoso.com/*.
  2. Add a mock whose request.url is https://api.contoso.com/Users.
  3. Send a request to https://api.contoso.com/users.

Expected: the mock is returned, consistent with how urlsToWatch matches.
Actual: the request is intercepted but no mock matches, so it passes through.

Notes

#113 reported the same problem in 2023 and was closed without a code change.

Activity

  1. added a commit that references this issue on Oct 20, 2026
    063b118
  2. added a commit that references this issue on Oct 21, 2026
    50ba691
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions