You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2020/10/01 21:52:48 UTC

[GitHub] [sling-org-apache-sling-engine] ghenzler commented on a change in pull request #10: SLING-9662 Use SlingUri as provided in request from auth.core

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



##########
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:
       So in my tests it seemed like this case is impossible (since all requests pass through `auth.core`), hence implementing  a fallback here would produce "dead code" - can you think of a scenario when `auth.core` is not setting `REQUEST_ATTRIBUTE_URI`?




----------------------------------------------------------------
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:
users@infra.apache.org