cziegeler commented on a change in pull request #10:
URL: 
https://github.com/apache/sling-org-apache-sling-engine/pull/10#discussion_r498646696



##########
File path: src/main/java/org/apache/sling/engine/impl/request/RequestData.java
##########
@@ -237,19 +237,17 @@ public Resource initResource(ResourceResolver 
resourceResolver) {
         requestProgressTracker.startTimer("ResourceResolution");
         final SlingHttpServletRequest request = getSlingRequest();
 
-        StringBuffer requestURL = servletRequest.getRequestURL();
-        String path = request.getPathInfo();
-        if (requestURL.indexOf(";") > -1 && !path.contains(";")) {
-            final String decodedURL;
-            try {
-                decodedURL = URLDecoder.decode(requestURL.toString(), "UTF-8");
-            } catch (UnsupportedEncodingException e) {
-                throw new AssertionError("UTF-8 encoding is not supported");
-            }
-            path = path.concat(decodedURL.substring(decodedURL.indexOf(';')));
+        // Set by o.a.s.auth.core bundle
+        SlingUri slingUri = (SlingUri) 
request.getAttribute(AuthenticationSupport.REQUEST_ATTRIBUTE_URI);

Review comment:
       I don't like implicit contracts, it is not clear that when calling this 
method, the request attribute needs to be set. This might pose a problem over 
time. I guess the other situation is when an old auth.core bundle is used - I 
would assume that the engine does not have an import auth.core as its only 
using constants.
   We have dead code nevertheless, either the dead code is throwing an 
exception or creating a new SlingUri :)




----------------------------------------------------------------
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.

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


Reply via email to