Hans-Peter Stoerr created SLING-9514:
----------------------------------------

             Summary: ResourceResolver.map should encode # and ?
                 Key: SLING-9514
                 URL: https://issues.apache.org/jira/browse/SLING-9514
             Project: Sling
          Issue Type: Bug
    Affects Versions: Resource Resolver 1.6.16
            Reporter: Hans-Peter Stoerr


According to SLING-8084 [ResourceResolver.map(request, 
url)|[https://sling.apache.org/apidocs/sling11/org/apache/sling/api/resource/ResourceResolver.html#map-javax.servlet.http.HttpServletRequest-java.lang.String-]]
 does a percent encoding, so that the result is a valid URL. Unfortunately it 
doesn't do that for the characters ? and #, which have special meanings in 
HTTP. I suggest also encoding these - otherwise the returned URL will not 
retrieve the resource when its name contains one of these characters.

For good measure, I wonder whether it would be sensible to percent-encode other 
characters that have a special meaning in URLs as well, such as "=", ";",  ":", 
"&", though that is not mandatory. 

I also suggest mentioning the encoding in [the description of the 
mapping|[https://sling.apache.org/documentation/the-sling-engine/mappings-for-resource-resolution.html]].


Thanks so much!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to