Closed GoogleCodeExporter closed 9 years ago
What about adding this in SiteFilter?
if (url.endsWith("/")) {
httpResponse.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
httpResponse.setHeader("Location", url.substring(0, url.length() -1 ));
httpResponse.setHeader("Connection", "close");
return;
}
Theorically there should be no URLs stored at Vosao with a trailing slash, it
is not allowed to use a slash when defining a URL. However, one can use the
slash when defining SEO Urls, so at least the code should be inserted after the
conditional checking for SEO Urls at line 115.
In my opinion, line 135 after url.equals("/") conditional would be a good
place. This way we don't need to check if the url is equals to "/", and more
important, we should see this case unusual and not likely to happen. So instead
of unnecessarily checking every correct URL without and slash at the end, we
will handled it at the end.
Original comment by raimon.r...@rarejava.com
on 16 Aug 2011 at 12:22
This issue was closed by revision r1088.
Original comment by kinyelo@gmail.com
on 16 Aug 2011 at 5:58
Original issue reported on code.google.com by
kinyelo@gmail.com
on 6 Aug 2011 at 4:52