Request Path and query parameter keys are case-sensitive #164

Closed
opened 2025-12-29 14:24:05 +01:00 by adam · 11 comments
Owner

Originally created by @simardst on GitHub (Mar 6, 2019).

In many cases, the casing of the request path and the querystring keys (not the values) is not important. It would be very usefull to:

  • be able to match the request path in a case-insensitive way.
  • be able to math the request querystring keys in a case insensitive way.

This could be a global settings or configurable for each request (whatever is the simplest way to implement it).

Originally created by @simardst on GitHub (Mar 6, 2019). In many cases, the casing of the request path and the querystring keys (not the values) is not important. It would be very usefull to: - be able to match the request path in a case-insensitive way. - be able to math the request querystring keys in a case insensitive way. This could be a global settings or configurable for each request (whatever is the simplest way to implement it).
adam closed this issue 2025-12-29 14:24:05 +01:00
Author
Owner

@StefH commented on GitHub (Mar 6, 2019):

For path , you should be able to use:

"Request": {
        "Path": {
            "Matchers": [
                {
                    "Name": "WildcardMatcher",
                    "Pattern": "/param2",
                    "IgnoreCase": true
                }
            ]
        },
        "Methods": [
            "get"
        ]
    },
@StefH commented on GitHub (Mar 6, 2019): For **path** , you should be able to use: ``` js "Request": { "Path": { "Matchers": [ { "Name": "WildcardMatcher", "Pattern": "/param2", "IgnoreCase": true } ] }, "Methods": [ "get" ] }, ```
Author
Owner

@simardst commented on GitHub (Mar 6, 2019):

Thank you, but achieving the same for the querystring keys is far more complex. I achieved to create an extension for the path, but didn't find any way to do the same with the querystring keys.

@simardst commented on GitHub (Mar 6, 2019): Thank you, but achieving the same for the querystring keys is far more complex. I achieved to create an extension for the path, but didn't find any way to do the same with the querystring keys.
Author
Owner

@StefH commented on GitHub (Mar 6, 2019):

Cookies and Headers do support this logic.

But I think indeed that querystring does not support this.

I will take a look at the code to ser if I can add logic.

@StefH commented on GitHub (Mar 6, 2019): Cookies and Headers do support this logic. But I think indeed that querystring does not support this. I will take a look at the code to ser if I can add logic.
Author
Owner

@StefH commented on GitHub (Mar 7, 2019):

I've updated the code and new NuGet is available on MyGet (https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions)
WireMock.Net.1.0.8-ci-11023

Use it like:

{
    "Guid": "6dcb57d1-2571-48d8-98fd-fc1c877104d3",
    "Request": {
        "Path": {
            "Matchers": [
                {
                    "Name": "WildcardMatcher",
                    "Pattern": "/param",
                    "IgnoreCase": true
                }
            ]
        },
        "Methods": [
            "get"
        ],
        "Params": [
            {
                "Name": "KeY",
                "IgnoreCase": true,
                "Matchers": [
                    {
                        "Name": "ExactMatcher",
                        "Pattern": "test"
                    }
                ]
            }
        ]
    },
    "Response": {
        "BodyAsJson": {
            "result": "!!!"
        }
    }
}

Will match:
http://localhost/param?key=test
and
http://localhost/param?kEY=test

@StefH commented on GitHub (Mar 7, 2019): I've updated the code and new NuGet is available on MyGet (https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions) **WireMock.Net.1.0.8-ci-11023** Use it like: ``` js { "Guid": "6dcb57d1-2571-48d8-98fd-fc1c877104d3", "Request": { "Path": { "Matchers": [ { "Name": "WildcardMatcher", "Pattern": "/param", "IgnoreCase": true } ] }, "Methods": [ "get" ], "Params": [ { "Name": "KeY", "IgnoreCase": true, "Matchers": [ { "Name": "ExactMatcher", "Pattern": "test" } ] } ] }, "Response": { "BodyAsJson": { "result": "!!!" } } } ``` Will match: `http://localhost/param?key=test` and `http://localhost/param?kEY=test`
Author
Owner

@StefH commented on GitHub (Mar 8, 2019):

@simardst does this work for you?

@StefH commented on GitHub (Mar 8, 2019): @simardst does this work for you?
Author
Owner

@simardst commented on GitHub (Mar 8, 2019):

This seems to resolve our issues, and I will test it using your preview version by the end of the day.
Thank you very much.

@simardst commented on GitHub (Mar 8, 2019): This seems to resolve our issues, and I will test it using your preview version by the end of the day. Thank you very much.
Author
Owner

@StefH commented on GitHub (Mar 8, 2019):

You're welcome.

If you have tested and all is working as expected, I'll merge this code to master and create a new official nuget.

@StefH commented on GitHub (Mar 8, 2019): You're welcome. If you have tested and all is working as expected, I'll merge this code to master and create a new official nuget.
Author
Owner

@simardst commented on GitHub (Mar 8, 2019):

I, ve done few tests. This works perfectly!
I will update as soon as it is available.

@simardst commented on GitHub (Mar 8, 2019): I, ve done few tests. This works perfectly! I will update as soon as it is available.
Author
Owner

@StefH commented on GitHub (Mar 9, 2019):

So all is tested and I can merge and create a new official NuGet?

@StefH commented on GitHub (Mar 9, 2019): So all is tested and I can merge and create a new official NuGet?
Author
Owner

@simardst commented on GitHub (Mar 11, 2019):

As far as I'm concerned, yes you can proceed.

@simardst commented on GitHub (Mar 11, 2019): As far as I'm concerned, yes you can proceed.
Author
Owner

@StefH commented on GitHub (Mar 12, 2019):

A new NuGet will be released soon.

@StefH commented on GitHub (Mar 12, 2019): A new NuGet will be released soon.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#164