Path-based routing without ending slash Azure Application Gateway

I'm currently working on Azure Application Gateway to redirect request to 2 WebApi using Path-based rule as below:

"/foo/*" -> FooApi
"/bar/*" -> BarApi

And a default backend api that does nothing for now.

When I request to http://mygateway.azure.com/foo/, it works fine. But if I missed an ending slash, so with the URL http://mygateway.azure.com/foo, it returns 500 URL Rewrite Module Error.

Current ApplicationGatewayBackendHttpSettings I set -Path to "/".

I tried to add few more routes to the rule liked "/foo", "/foo/", but it doesn't work.

Any advises, please?