Ok I’ve found the issue that is causing the problem:
https://bz.apache.org/bugzilla/show_bug.cgi?id=59317

Specifically it says:

“
Async and non-async behaviours are currently the same.
        • Both expect the path used to obtain the dispatcher to be decoded. 
This behavior was confirmed with the Servlet EG.
        • Both return the unencoded URI for req.getRequestURI(). That strikes 
me as wrong.
"

And

“
The restriction the the request dispatcher (or the async dispatch) must be 
obtained with a decoded path has not changed. However, I have applied a fix 
that ensures that the result of the call to getRequestURI() after the dispatch 
returned an encoded URI.
“

It would be nice to have more information about " This behavior was confirmed 
with the Servlet EG.". The Servlet spec doesn't mention anything and this makes 
Tomcat have a different behavior than other servlet containers (Jetty for 
example).

I believe this change is dangerous and is going to cause regression to lots of 
applications out there who used to work with an encoded dispatcher path and 
that are now going to not work anymore (as is the case with XWiki, see 
http://jira.xwiki.org/browse/XWIKI-13556).

Could someone from the Tomcat dev team please comment on this?

Thanks
-Vincent


> On 08 Jul 2016, at 22:00, Vincent Massol <vinc...@massol.net> wrote:
> 
> Hi guys,
> 
> I work on the XWiki project (http://xwiki.org) and we’ve had several reports 
> of users telling us that XWiki is not working anymore with versions of Tomcat 
> > 7.0.69 and > 8.0.33. It works perfectly well with those versions and lower.
> 
> The issue is described in more detail at 
> http://jira.xwiki.org/browse/XWIKI-13556
> 
> In short, I’ve tracked down one of the issues and here’s the problem we have:
> 
> * We use context.getRequest().getRequestDispatcher(path).forward(…).
> * We are url-encoding the path. For example:path =  
> /bin/view/Main/test%20with%20space
> * With Tomcat > 7.0.69 and > 8.0.33 (I’m testing with versions 8.0.36 and 
> 7.0.59 to be precise) this generates an incoming URL of 
> .../bin/view/Main/test%2520with%2520space in our code
> * With Tomcat <= 7.0.69 and <= 8.0.33 it was generating an incoming URL of 
> .../bin/view/Main/test%20with%20space in our code
> 
> Also note that with Jetty 9.2.13.v20150730 if we don’t url-encode the path 
> passed to getRequestDispatcher(path) then Jetty generates an incoming URL of 
> .../bin/view/Main/test with space in our code, which is of course invalid and 
> fails.
> 
> So I wanted to ask you two questions:
> * Would someone know the change in Tomcat that brought this difference from 
> previous versions?
> * Who’s right? :)
> 
> Thanks for any help
> 
> -Vincent
> XWiki Committer


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to