0

My route is

"Routes": [
{
    "RouteId": "routegreen",
    "ClusterId": "clustergreen",
    "Match": {
        "Path": "/api/myendpoint"
    }
}

It is not matched for requests going to /api/MyEndpoint. Is it possible to make it case insensitive?

Dai
  • 141,631
  • 28
  • 261
  • 374
Mathias F
  • 15,906
  • 22
  • 89
  • 159

1 Answers1

1

You cannot. These are not Windows filenames - URL's included in routing are always case sensitive. You have no choice but to rename, either in the routing addresses, or your method name, to match case exactly.

Goodies
  • 1,951
  • 21
  • 26
  • I totally get it that an url should be case sensitive but the configuration might have an option for case insensitiv matching. I actually find something in the source of yarp (matcher.IsCaseSensitive) , just need to find the correct syntax for it – Mathias F Jan 25 '21 at 13:25
  • I dont think it exists. In .NET ASP there is (was) case-insensitive routing, but for Core they already changed that. Don't know about yarp actually, but it simply should not be there. Routing is case-sensitive. You'll have to set up a separate routing case for MyEndpoint explicitly. – Goodies Jan 25 '21 at 14:56
  • 1
    I guess you are right matcher.IsCaseSensitive was actually for matching header values – Mathias F Jan 25 '21 at 16:21