You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Pierre-Luc Rigaux (JIRA)" <ji...@apache.org> on 2010/10/15 21:41:33 UTC
[jira] Created: (SLING-1846) URL decoding
URL decoding
------------
Key: SLING-1846
URL: https://issues.apache.org/jira/browse/SLING-1846
Project: Sling
Issue Type: Bug
Reporter: Pierre-Luc Rigaux
When we send an encoded url it is not decoded by Sling and it result by a 404 answer.
Exemple
"/test/My%20story.doc" should be decoded to "/test/My%20story.doc"
"%E9%9F%B3%E4%B9%90.mp3" should be decoded to "音乐.mp3"
My workaround was to add this code to org.apache.sling.engine.impl.SlingHttpServletRequestImpl.SlingHttpServletRequestImpl(RequestData, HttpServletRequest) construtor
// prepare the pathInfo property
String pathInfo = servletRequest.getServletPath();
if (servletRequest.getPathInfo() != null) {
pathInfo = pathInfo.concat(servletRequest.getPathInfo());
try {
pathInfo = URLDecoder.decode(pathInfo, "UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
this.pathInfo = pathInfo;
By checking a bit the method javax.servlet.http.HttpServletRequest.getServletPath() should return a decoded url, witch it is not the case. I find out that implementation was the felix one, but I didn't go further.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SLING-1846) URL decoding
Posted by "Justin Edelson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SLING-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921704#action_12921704 ]
Justin Edelson commented on SLING-1846:
---------------------------------------
It sounds like you're saying this is a bug in the Felix HttpService implementation. If so, it should be fixed there.
> URL decoding
> ------------
>
> Key: SLING-1846
> URL: https://issues.apache.org/jira/browse/SLING-1846
> Project: Sling
> Issue Type: Bug
> Reporter: Pierre-Luc Rigaux
>
> When we send an encoded url it is not decoded by Sling and it result by a 404 answer.
> Exemple
> "/test/My%20story.doc" should be decoded to "/test/My%20story.doc"
>
> "%E9%9F%B3%E4%B9%90.mp3" should be decoded to "音乐.mp3"
> My workaround was to add this code to org.apache.sling.engine.impl.SlingHttpServletRequestImpl.SlingHttpServletRequestImpl(RequestData, HttpServletRequest) construtor
> // prepare the pathInfo property
> String pathInfo = servletRequest.getServletPath();
> if (servletRequest.getPathInfo() != null) {
> pathInfo = pathInfo.concat(servletRequest.getPathInfo());
> try {
> pathInfo = URLDecoder.decode(pathInfo, "UTF-8");
> } catch (UnsupportedEncodingException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> }
> this.pathInfo = pathInfo;
> By checking a bit the method javax.servlet.http.HttpServletRequest.getServletPath() should return a decoded url, witch it is not the case. I find out that implementation was the felix one, but I didn't go further.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.