[ 
https://issues.apache.org/jira/browse/SLING-9514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17134144#comment-17134144
 ] 

Julian Reschke commented on SLING-9514:
---------------------------------------

"?" and "#" have special meaning in URIs in general, not just in HTTP.

Also, please confuse things that have special meaning in URIs with those with 
are just special inside the query portion of the URI (which is a somewhat 
different layer).

> 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
>            Priority: Minor
>
> 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