Skip to content
Snippets Groups Projects
Commit f01d0d99 authored by srosse's avatar srosse
Browse files

no-jira: don't send error page for 401/404 in mapper dispatcher

parent c742100c
No related branches found
No related tags found
No related merge requests found
......@@ -88,20 +88,21 @@ public class MapperDispatcher extends LogDelegator implements Dispatcher {
// e.g. non-cacheable: 23423
// e.g. cacheable: my.mapper.path
UserSession usess = CoreSpringFactory.getImpl(UserSessionManager.class).getUserSession(hreq);
Mapper m = CoreSpringFactory.getImpl(MapperService.class).getMapperById(usess, smappath);
MapperService mapperService = CoreSpringFactory.getImpl(MapperService.class);
Mapper m = mapperService.getMapperById(usess, smappath);
if (m == null) {
//an anonymous mapper?
m = CoreSpringFactory.getImpl(MapperService.class).getMapperById(null, smappath);
m = mapperService.getMapperById(null, smappath);
if(m == null) {
logWarn("Call to mapped resource, but mapper does not exist for path::" + smappath, null);
DispatcherModule.sendNotFound(pathInfo, hres);
hres.setStatus(HttpServletResponse.SC_NOT_FOUND);
return;
}
}
String mod = slashPos > 0 ? subInfo.substring(slashPos) : "";
if (mod.indexOf("..") != -1) {
logWarn("Illegal mapper path::" + mod + " contains '..'", null);
DispatcherModule.sendForbidden(pathInfo, hres);
hres.setStatus(HttpServletResponse.SC_FORBIDDEN);
return;
}
// /bla/blu.html
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment