|
|
Re: Trailing slash added after entry point path leads to 404 not found [message #1615981 is a reply to message #1615100] |
Sat, 14 February 2015 08:15 |
Arnaud MERGEY Messages: 243 Registered: March 2010 Location: France |
Senior Member |
|
|
Let me clarify why I think there is a regression
requesting http://rap.eclipsesource.com/demo/release/workbench/app/
We are in workbench, in osgi so we goes through org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(HttpServletRequest, HttpServletResponse)
Quote:// perfect match
if (processAlias(req, resp, alias, null))
return;
String extensionAlias = findExtensionAlias(alias);
alias = alias.substring(0, alias.lastIndexOf('/'));
// longest path match
while (alias.length() != 0) {
if (processAlias(req, resp, alias, extensionAlias))
return;
alias = alias.substring(0, alias.lastIndexOf('/'));
}
In both case (RAP 2.2, and 2.3) if there is a servlet in / path of app context equinox ProxyServlet will find it and redirect to it directly (in code next to "perfect math" comment).
If there is no servlet registered here, ProxyServlet will not find anything so we go through code next to "longest path match" where ProxyServlet remove the trailing slash
In Both case (RAP 2.2 and 2.3) ProxyServlet goes through RWTServlet because it finds the entry point registered to /app path. My guess was, as the request goes througs entry point registered to /app, RWTServlet should process the request and service the entry point defined for /app.
In RAP 2.2 it is like it works because of a side effect (RWTServlet redirects /app/ to /app but it has already been reach by /app, so it should been able to serve it directly). In RAP 2.3 it does not work anymore because RWTServlet responds with a 404 but as RWTServlet has been reached for the /app entry point, it should also be able to serve it.
I have not investigated more but I guess the behavior is a bit different between regular RWT web application and while RWTServlet behavior works and has not changed, it is not the same for RAP osgi applications and this regression only concerned this case.
Of course I still can register a RedirectServlet in / of path context, but I would have to do it for RAP every entry point I declare in the application.
At least if breaking this behavior is something expected, the documentation should warn users about it, because it is not uncommon to think http://rap.eclipsesource.com/demo/release/workbench/app/ will serve http://rap.eclipsesource.com/demo/release/workbench/app if there is nothing registered in http://rap.eclipsesource.com/demo/release/workbench/app/ (confirmed by the fact that Equinox ProxyServlet has been coded with this kind of logic), and as it uses to work before.
Best
Arnaud
[Updated on: Sat, 14 February 2015 08:42] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02326 seconds