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

Darryl L. Miles commented on WICKET-4625:
-----------------------------------------

Note I think that in the scenario where:

contextPath="/context"
filterPrefix="/wicket/"
uri="/context/wicket-foobar"

Then it would errornously return "foobar" is this a problem for this method ?

This would be fixed by doing a "string compare and return number or identical 
characters matched method", instead of the new use of String#startswith(String) 
method.

However I believe that in a real world application it is WicketFilter's job to 
ensure the trailing slash is there and not pass control into Wicket for my 
example "/context/wicket-foobar" above.  I just through I'd

                
> ServletWebRequest#getContextRelativeUrl() sometimes chops off leading 
> characters
> --------------------------------------------------------------------------------
>
>                 Key: WICKET-4625
>                 URL: https://issues.apache.org/jira/browse/WICKET-4625
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.5.7
>            Reporter: Darryl L. Miles
>         Attachments: 
> 0001-WICKET-4625-ServletWebRequest-getContextRelativeUrl-.patch
>
>
> This patch reduces the number of nonsense return value this method might 
> produce.  I have clarified the in JavaDoc the expected inputs to the method.  
> It is still possible to still get a nonsense return values in some use cases, 
> all scenarios are documented and tested in a new test case.
> This method presumes that the input "uri" on the 1st argument always has the 
> ContextPath and then the FilterPrefix on the front of the URL.
> Some unit tests were actually checking the nonsense return values were being 
> returned these have been updated.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to