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

James Phillpotts commented on SLING-2543:
-----------------------------------------

Hi Carsten, I can see quite a lot of test failures (I'm looking here - I guess 
this is right? 
https://builds.apache.org/view/S-Z/view/Sling/job/sling-trunk-1.6/), most of 
which don't seem to have anything to do with this. I assume you mean these 3:

testForcedRedirect(org.apache.sling.launchpad.webapp.integrationtest.PostRedirectTest):
 With forced redirect and Referer, redirect must be forced 
expected:<http://[]forced> but 
was:<http://[localhost:46258/CreateNodeTest/1348606571797/_http_//]forced>
  
testDefaultRedirect(org.apache.sling.launchpad.webapp.integrationtest.PostRedirectTest):
 With no headers or parameters, redirect 
(http://localhost:46258/CreateNodeTest/37_1348606597735) must point to created 
node (path=CreateNodeTest/1348606571797)
  
testMagicStarRedirect(org.apache.sling.launchpad.webapp.integrationtest.PostRedirectTest):
 With magic star, redirect 
(http://localhost:46258/CreateNodeTest/38_1348606597742) must point to created 
node (path=CreateNodeTest/1348606571797)

Of these, I'm not sure I understand the second and third - prefixes 37_ and 38_ 
seem to have been added in the middle of the URL - I can't see that encoding 
the returned URL would do this. The first looks like it might be a bug in Jetty 
6 that looks like it might be fixed in Jetty 8 - we can strip of the pre-path 
part of the URL and reattach after encoding?

It would also be useful if the redirection included debug logging so that one 
could trace what was being returned as the redirect URL.

I'll add a new patch to do these two things shortly.
                
> SlingPostServlet is not encoding redirect URLs
> ----------------------------------------------
>
>                 Key: SLING-2543
>                 URL: https://issues.apache.org/jira/browse/SLING-2543
>             Project: Sling
>          Issue Type: Bug
>          Components: Servlets
>    Affects Versions: Servlets Post 2.1.2
>            Reporter: James Phillpotts
>            Assignee: Bertrand Delacretaz
>             Fix For: Servlets Post 2.1.4
>
>         Attachments: SLING-2543.patch
>
>
> According to the JavaEE documentation for 
> HttpServletResponse.encodeRedirectURL, "All URLs sent to the 
> HttpServletResponse.sendRedirect method should be run through this method."
> The SlingPostServlet isn't doing this, and so if you try and redirect to a 
> node that contains special characters in the name, the redirect URL is 
> incorrect.
> e.g. A post request containing :name of Друга and :redirect of *.html gets a 
> redirect URL of ?????.html rather than %D0%94%D1%80%D1%83%D0%B3%D0%B0.html as 
> would be expected.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to