Yes, that’s the way I do it too! High five
I use $_SERVER.PATH_INFO
instead of $_SERVER.URL
, and I use the .startsWith
formatter rather than .contains
. I suggest you do the same
Set Value pathinfo = {{ $_SERVER.PATH_INFO }}
Condition {{ pathinfo.startsWith("/api/admin") }}
I actually use an array to store the paths that need to be restricted, and then I use a Repeat step to iterate on each array element (each path that needs to be restricted) and check if it matches the current path
Also, see my initial discussion regarding this matter here: