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



##########
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");

Review comment:
       Not in `SlingUri`,  idea is to allow `SlingUri` to contain both encoded 
and non-encoded values (non-encoded is unproblematic as long as the URI 
components are in separate fields, it only gets problematic when you serialize 
it to a String, see 
[SLING-9777](https://issues.apache.org/jira/browse/SLING-9777) for details.
   
   But the idea is that  
[PathToUriMappingServiceImpl.getSlingUriFromRequest()](https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/4ab43acf49dfd9cd25119b74054980b3c4144918/src/main/java/org/apache/sling/resourceresolver/impl/urimapping/PathToUriMappingServiceImpl.java#L201)
 takes care of it, it uses the methods `request.getServletPath()` and 
`request.getPathInfo()` that both return already decoded values according to 
[javadoc 
HttpServletRequest](https://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#getServletPath())
   
   But now looking at 
[SLING-4804](https://issues.apache.org/jira/browse/SLING-4804) and @trekawek 's 
commit 83acbff6b08f52a50aa it looks the path parameter is not contained in 
getServletPath(), so the most likely current version needs a fix, however this 
should be done in 
[PathToUriMappingServiceImpl.getSlingUriFromRequest()](https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/4ab43acf49dfd9cd25119b74054980b3c4144918/src/main/java/org/apache/sling/resourceresolver/impl/urimapping/PathToUriMappingServiceImpl.java#L201)
 then. I'll take care of it.
   




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