fix path matching for string type of path

## fix path matching

with the following fixes:

1. in `string`-type path, handles the trailing slash.
2. in `string`-type path, ensure constraints are also checked.
3. consider `*` in `regex` type of path