In case of proxy.pathsuffix, I need to check if the URL ends with certain text. Is there a possibility to achieve this

Not applicable

I have 2 flows,

1. Condition proxy.pathsuffix MatchesPath /{id}/text

2. Condition proxy.pathsuffix MatchesPath /{id}

When I pass the URL as http://www.test.com/text, it is going to second condition since the condition is satisfied and id gets the value text. Is there a way to handle this issue

0 3 1,064
3 REPLIES 3

Dear @Rashmi.Murthy1 ,

Yes, It's possible. You can use regular expression to do this. Use JavaRegex. For more details refer here.

Or you can just say

proxy.pathsuffix MatchesPath **/text

Cheers,

Anil Sagar

Hi Anil

Thanks for responding. We are more interested in throwing back an error if id is not passed in the URL mentioned above.

http://www.test.com/text - should yield an error since id is not passed. But it goes to Condition 2, and treats text as id, which we dont need.

Please let us know, if there is a way to handle this. I see that there is something called startsWith operartor to check the suffix. What we are looking for is more of endsWith kind of operator.

Dear @Meghna.Madhusudan ,

You need to use Raise Fault policy and use condition as proxy.pathsuffix MatchesPath /text to raise custom error.

Cheers,

Anil Sagar