Copilot commented on code in PR #16311:
URL: https://github.com/apache/grails-core/pull/16311#discussion_r3931679457


##########
grails-interceptors/src/main/groovy/org/grails/plugins/web/interceptors/UrlMappingMatcher.groovy:
##########
@@ -61,16 +64,20 @@ class UrlMappingMatcher implements Matcher {
     }
 
     boolean doesMatch(String uri, UrlMappingInfo info, String method) {
+        doesMatch(uri, info, method, null)
+    }
+
+    boolean doesMatch(String uri, UrlMappingInfo info, String method, String 
contextPath) {
         boolean hasUriPatterns = !uriPatterns.isEmpty()
+        String path = canonicalizePath(uri)

Review Comment:
   `Interceptor.doesMatch` passes this overload the result of 
`UrlPathHelper.getPathWithinApplication`, which is already decoded, but 
`canonicalizePath` decodes it again. For example, `/%2561dmin/deleteUser` is 
dispatched as `/%61dmin/deleteUser` but is matched here as `/admin/deleteUser`; 
an `/admin/**` exclusion can therefore skip an interceptor for a different 
dispatched path. Treat the four-argument overload as already decoded and only 
perform the post-decode semicolon cleanup; keep full canonicalization for the 
raw three-argument overload.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to