Skip to content

Commit

Permalink
Improves Rest Layer Authz robustness
Browse files Browse the repository at this point in the history
Signed-off-by: Darshit Chanpura <[email protected]>
  • Loading branch information
DarshitChanpura committed Nov 5, 2024
1 parent 1c898dc commit 6108c30
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ public void onAllowlistingSettingChanged(AllowlistingSettings allowlistingSettin
* @return true if the request path matches the route
*/
private boolean restPathMatches(String requestPath, String handlerPath) {
// Trim leading and trailing slashes
requestPath = requestPath.replaceAll("^/+", "").replaceAll("/+$", "");
handlerPath = handlerPath.replaceAll("^/+", "").replaceAll("/+$", "");
// Check exact match
if (handlerPath.equals(requestPath)) {
return true;
Expand Down

0 comments on commit 6108c30

Please sign in to comment.