case-insensitive MatchesPath

We run IIS servers, not Tomcat servers. URLs are case-insensitive. We don't want to allow any undefined path to hit our servers, so have implemented a Raise-Fault if the path isn't in Apigee. Unfortunately, Apigee is case-sensitive. We need an _EASY_!!! way to turn all 'MatchesPath' references to 'MatchesPathInsensitive' -- a case-insenitive MatchesPath. Please. How do we do this in a SIMPLE EASY way?

I've read the docs on this and it's a bunch of custom stuff to make this happen.

These APIs are imported project.json files that come from Swashbuckle, so whatever is in the Route in the Controller is there -- casing and all.

Solved Solved
1 6 2,076
1 ACCEPTED SOLUTION

This works:

<Flow name="ApiWebLogPost"> <Description/> <Request/> <Response/> <Condition>(proxy.pathsuffix EqualsCaseInsensitive "/api/WebLog") and (request.verb = "POST")</Condition> </Flow>

View solution in original post

6 REPLIES 6

Yes, case insensitive matching is not possible with the MatchesPath operator.

But you can use a regular expression to do it. Do you know Regex?

You could do something like this:

<Condition>proxy.pathsuffix ~~ "(?i)^/path1$" and request.verb = "GET"</Condition>

and it would match on

  • /path1
  • /Path1
  • /PAth1
  • /PATH1
  • /pAth1
  • etc

Thank you . That might work.

However, these APIs are imported from swagger.json, and the process needs to be automated.

It would be very helpful if there were some control on the importer to make this happen automatically.

Having to edit 1000s of APIs individually is extremely inefficient.

Hi @Richard Giaimo,

Have you found on how to ignore case for the condition?

This works:

<Flow name="ApiWebLogPost"> <Description/> <Request/> <Response/> <Condition>(proxy.pathsuffix EqualsCaseInsensitive "/api/WebLog") and (request.verb = "POST")</Condition> </Flow>

@Richard Graves - That works great for the endpoint, but the basepath is still case sensitive.

@Richard Giaimo

Used this one. Confirming that this works in my API proxy. Thanks!